From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [Patch net] net: drop skb on failure in ip_check_defrag() Date: Thu, 1 Nov 2018 12:08:40 -0700 Message-ID: <4d4d6572-b6ec-edaf-d88e-5097d1b4cb1c@gmail.com> References: <20181101190237.10830-1-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Eric Dumazet To: Cong Wang , netdev@vger.kernel.org Return-path: Received: from mail-pg1-f182.google.com ([209.85.215.182]:38480 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbeKBEM5 (ORCPT ); Fri, 2 Nov 2018 00:12:57 -0400 Received: by mail-pg1-f182.google.com with SMTP id f8-v6so9465806pgq.5 for ; Thu, 01 Nov 2018 12:08:43 -0700 (PDT) In-Reply-To: <20181101190237.10830-1-xiyou.wangcong@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/01/2018 12:02 PM, Cong Wang wrote: > Most callers of pskb_trim_rcsum() simply drop the skb when > it fails, however, ip_check_defrag() still continues to pass > the skb up to stack. This is suspicious. > > In ip_check_defrag(), after we learn the skb is an IP fragment, > passing the skb to callers makes no sense, because callers expect > fragments are defrag'ed on success. So, dropping the skb when we > can't defrag it is reasonable. > > Note, prior to commit 88078d98d1bb, this is not a big problem as > checksum will be fixed up anyway. After it, the checksum is not > correct on failure. > > Found this during code review. > > Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends") > Cc: Eric Dumazet > Signed-off-by: Cong Wang Thanks Cong ! Reviewed-by: Eric Dumazet