From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 998DFC43613 for ; Thu, 20 Jun 2019 18:13:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BB402168B for ; Thu, 20 Jun 2019 18:13:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054389; bh=Xr8RRqfm6iC62CPmAI2DjDo2oSRBq9HZpmm18yqeb0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tMPa1yukXzPhTXN9VXh/aFtUdHoQFUSrRp6zi12RtgRqILurQn6bMy8J3yoJdqmF9 ZVaHiBjmB9irYhaRPqSX3OLnIoVyYhFmIUFqbVH8d8ZDJSC9wmEIF0p6eco1I9LHMw AaV14ExjwvDYzeKOGyIRjfu4k2RoGUiPlNTgDfw8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbfFTSNI (ORCPT ); Thu, 20 Jun 2019 14:13:08 -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;