Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp973504ybl; Fri, 24 Jan 2020 13:00:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyQjGrn3Jg+X36dKvhGKaRRUXlM8s44/GyELuyqs3LL/6MELKfviCgsDfgE6LR2ZnleHF/R X-Received: by 2002:a05:6830:1e2b:: with SMTP id t11mr4378034otr.81.1579899643183; Fri, 24 Jan 2020 13:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899643; cv=none; d=google.com; s=arc-20160816; b=sr2Ckd0GejBwnOqAUGkW69j1hD7oCTWRsxV7c6/7GW1nD6kSzV6kh5nZmVFf9nU6sQ tIGe28hD0t6FiPy7ctDUMiaYJ3l+luQZv+KBKa55Orxc0W+EqRlpwWoYe8YrEo6+dh7s fznPGRHOPU31TQqQRCd17Jmsx0wK50mTcSNjY5ASoh6Ghml8n5fptmi/V6kHi8BOXDeK aug2N4ZMA5sJ640eB/nW9UJG2fL9C/NmyvnFDrizprMQaDcHWZOXiR8wn63uF/dYJd2B X844U6UVeZ9r+CAniDgPMv6mNP4+hA0KPh+g8kCQyHTTcO2IKZC16bmzQ+OkA1SRDRU2 /eGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=18Dn1AGGUz6AX6KVH5Ea2DiVvxR8vu0vlRaBRJv4x/c=; b=y4kMh7gGUKmPLZC+ShyVAMFkFhi8ptN46jiUDvKZ4SHQmsL1cZosPPVFwCJgV3mHjL X8U9omCegjcf4nrNuCASohTYSUCA2MSEhTQEMjuy14UQ41ciKME6u18pzN1fz6iLRLVN fHRkrnuvxhSHBt9DQnZvAAOKtjssiEiYatraHObUxg3ZwOKpmSTnznRvwqJvCMKtU+0/ kLCAEBiVTa/IYgjeriK/9DYrd0d0Jaf240NikVdzfjClJ9gkFy5e1kOigHWJBC0NIJPG JosfJ2rNHcPFAJ1UJm+wMCCCzK6TcaU6Gwm49A541UqlwLcad+SctFJ6M1+d5+h7Lz5j VAOw== ARC-Authentication-Results: i=1; mx.google.com; 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 h2si3616368otn.100.2020.01.24.13.00.31; Fri, 24 Jan 2020 13:00:43 -0800 (PST) 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; 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 S2391797AbgAXTEh (ORCPT + 99 others); Fri, 24 Jan 2020 14:04:37 -0500 Received: from correo.us.es ([193.147.175.20]:44614 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387973AbgAXTEh (ORCPT ); Fri, 24 Jan 2020 14:04:37 -0500 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 405D6BAEFE for ; Fri, 24 Jan 2020 20:04:36 +0100 (CET) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 2E317DA702 for ; Fri, 24 Jan 2020 20:04:36 +0100 (CET) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 15BE2DA713; Fri, 24 Jan 2020 20:04:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 159ABDA707; Fri, 24 Jan 2020 20:04:34 +0100 (CET) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Fri, 24 Jan 2020 20:04:34 +0100 (CET) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (unknown [90.77.255.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id E8D5342EE38E; Fri, 24 Jan 2020 20:04:33 +0100 (CET) Date: Fri, 24 Jan 2020 20:04:32 +0100 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Praveen Chaudhary Cc: fw@strlen.de, davem@davemloft.net, kadlec@netfilter.org, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenggen Xu , Andy Stracner Subject: Re: [PATCH v4] [net]: Fix skb->csum update in inet_proto_csum_replace16(). Message-ID: <20200124190432.vxcnnds3ypqa4hzh@salvia> References: <20200123142929.GV795@breakpoint.cc> <1579811608-688-1-git-send-email-pchaudhary@linkedin.com> <1579811608-688-2-git-send-email-pchaudhary@linkedin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1579811608-688-2-git-send-email-pchaudhary@linkedin.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 23, 2020 at 12:33:28PM -0800, Praveen Chaudhary wrote: > skb->csum is updated incorrectly, when manipulation for NF_NAT_MANIP_SRC\DST > is done on IPV6 packet. > > Fix: > There is no need to update skb->csum in inet_proto_csum_replace16(), because > update in two fields a.) IPv6 src/dst address and b.) L4 header checksum > cancels each other for skb->csum calculation. > Whereas inet_proto_csum_replace4 function needs to update skb->csum, > because update in 3 fields a.) IPv4 src/dst address, b.) IPv4 Header checksum > and c.) L4 header checksum results in same diff as L4 Header checksum for > skb->csum calculation. Applied, thanks.