Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2236088ybi; Thu, 20 Jun 2019 11:21:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzS/XuQzw8KOWPyUuGX0SmGaMTjNViSCjn3oomZGwMuDwt9ZsNy3WRRM0h7/gbh/t4eQSWz X-Received: by 2002:a62:e119:: with SMTP id q25mr95659700pfh.148.1561054881879; Thu, 20 Jun 2019 11:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054881; cv=none; d=google.com; s=arc-20160816; b=VCgH1FuIn9kNaSmYtko7WnJR1Hq49M1bQ2p0tg1n3XB+VVOnm7YPb9Gv5D6QuLPZJs vAn3jIXzbBbFDMzHJJ2t/u9fMCWiyCdnbWGLIR3jBpIO5HvgFHniYnBP7wBrJ0SvgOfL 3s11wFiZwNtJZnAq/1xBsBi6FuWBQp8fTJeaNU3E9HGBB0KjHh9r6kDUnC5mA7ZEzS2M sy67DI0Kqq1FOGPJs057a6HaRyhJM1UjO+6dHZKj+KRogjbtbdLe1Pk8b5kzRZJXoGI3 8KK4QglnQWCH4MtKI6KVQcLJ8Q3SodN1m6Ci1NNanZ3H5pRlel3M2Er06zQViGokpAph ENQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0AlhovLjslOFrbEdcWclPeY5bhIW+aX9GDVqc9BaQDI=; b=KSrtr1o42pUXUEZW04kDFXAZ0x4Mw/N2l1VyPUwGrIUCwFjhqWF56eVutYWaAxJkwV 1fzk08pgrqaG31iCrULon2lg6WgixU5RBM8gI4nzN9pW1AxSNZBw8PHF2p4B0iSnPZy9 pYIrdAJR62mPd/L4a5/JvmcOJ+lQOWmakCdkW7aM3CjHytvNKgPkDysmG7LyTXmgc4FF v5Cd9EUGo5nQXy13qrYljh5oxT8hV3w1RwIZOzrzQjjgyjf2p7yrHNGXZx9yhqH5Sc10 4lb339V8YthqyzA28x3n8DQUUImQ6zTEvy70LNKMHLsanfv4Kht0chHJiLY2ICzfu/3L Y7Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HpjuKxtS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si343361plo.404.2019.06.20.11.21.06; Thu, 20 Jun 2019 11:21:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HpjuKxtS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728964AbfFTSNH (ORCPT + 99 others); Thu, 20 Jun 2019 14:13:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:40932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729158AbfFTSNB (ORCPT ); Thu, 20 Jun 2019 14:13:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BECD721530; Thu, 20 Jun 2019 18:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054380; bh=Xr8RRqfm6iC62CPmAI2DjDo2oSRBq9HZpmm18yqeb0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HpjuKxtSvz9yDxEypXtp+RiqdbSiAU86kKCqcEzLTd+XENbscgCwVo7aalFWpFGI2 5ZLJZGKkQJniR0KM7lofaA+hwLUSW02dTFML4zd4QijLR923c4zuZXI5DbTd5vNPb4 RHiqM/RFX8GAvOp/UqR6Ap3JKYq+czZ+idcqltvo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Haber , Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 5.1 01/98] netfilter: nat: fix udp checksum corruption Date: Thu, 20 Jun 2019 19:56:28 +0200 Message-Id: <20190620174349.489982747@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Westphal commit 6bac76db1da3cb162c425d58ae421486f8e43955 upstream. Due to copy&paste error nf_nat_mangle_udp_packet passes IPPROTO_TCP, resulting in incorrect udp checksum when payload had to be mangled. Fixes: dac3fe72596f9 ("netfilter: nat: remove csum_recalc hook") Reported-by: Marc Haber Tested-by: Marc Haber Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_nat_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/nf_nat_helper.c +++ b/net/netfilter/nf_nat_helper.c @@ -170,7 +170,7 @@ nf_nat_mangle_udp_packet(struct sk_buff if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) return true; - nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_TCP, + nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_UDP, udph, &udph->check, datalen, oldlen); return true;