From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] udplite: fix partial checksum initialization Date: Fri, 16 Feb 2018 15:58:26 -0500 (EST) Message-ID: <20180216.155826.1914997978700216998.davem@davemloft.net> References: <1518715123-5990-1-git-send-email-alexey.kodanev@oracle.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, tom@herbertland.com To: alexey.kodanev@oracle.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:58896 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713AbeBPU62 (ORCPT ); Fri, 16 Feb 2018 15:58:28 -0500 In-Reply-To: <1518715123-5990-1-git-send-email-alexey.kodanev@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Alexey Kodanev Date: Thu, 15 Feb 2018 20:18:43 +0300 > Since UDP-Lite is always using checksum, the following path is > triggered when calculating pseudo header for it: > > udp4_csum_init() or udp6_csum_init() > skb_checksum_init_zero_check() > __skb_checksum_validate_complete() > > The problem can appear if skb->len is less than CHECKSUM_BREAK. In > this particular case __skb_checksum_validate_complete() also invokes > __skb_checksum_complete(skb). If UDP-Lite is using partial checksum > that covers only part of a packet, the function will return bad > checksum and the packet will be dropped. > > It can be fixed if we skip skb_checksum_init_zero_check() and only > set the required pseudo header checksum for UDP-Lite with partial > checksum before udp4_csum_init()/udp6_csum_init() functions return. > > Fixes: ed70fcfcee95 ("net: Call skb_checksum_init in IPv4") > Fixes: e4f45b7f40bd ("net: Call skb_checksum_init in IPv6") > Signed-off-by: Alexey Kodanev Applied and queued up for -stable, thanks Alexey.