Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5260580pxb; Wed, 26 Jan 2022 08:07:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTZ0I0Ny7j6MJJ0Qamsc8Od/YbEjpI5IU3CnZsfUyq98mgo822qcStvgFQSYeU3XSokwTz X-Received: by 2002:a17:903:110c:b0:149:9004:4e7c with SMTP id n12-20020a170903110c00b0014990044e7cmr23669701plh.167.1643213269359; Wed, 26 Jan 2022 08:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643213269; cv=none; d=google.com; s=arc-20160816; b=aaPbiZJvkj0glF1wkNll/LFSDTdtcqs+J8D+R3smsKoNvLXFLqTveGorgkcvYPdYkC rPPcJUQ85N9imjgB7awk2j4HlZuddQx3ra6UD9baoyumdPcUsDpROQu+bLk0rCXs5jqe qFufnUGdom3dZA30xv491+UNsUJuo8Q3qOr6ATBLFu2nltC5geEulXooFhyWYAadnNu1 72SBAZ/oYIV1cHeQkqmNxwkD/cI28CnBAY1sbzX6vMXU64jwL7thj7aoqTIkuHCTbjsa cMgbBbQMxLG9Nyf7jid8wt9uwvghDWFch8hDHPXpE4iGGmxD4BGLHixVU8nuksXFWATY +sHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x79rzXXTHBgOsXBjkeB1wHbZQHGb1pLifmwYG6i89Z4=; b=F0vy6oMs0FBb9h10zpmUEuKGzTTwx7gltJJn8OajDrsQLX1T8yp+VWgMEcJ2TB/sdk 2482uZ8ckjVJvBBG79QN0r2lPo95voqow6YlMw42ZhlXmh4GtxXzepm7wJ6ot7CQJ50i JL1yeu20x5CVJgm2F+NT8UrK1g2u1AyWbpdVMrL+Nk5Q4qCvKFApNeqyDC8DQieaPJCc svaNg4Kp7yiwT7fulWEONjPTqk3+ZJTmNrEwOCpytfxAROUXPGCkxwarlqL2JRGfGd9o +m/S2BvSmUZYcirIciFGLbiqxyM+LMJPkklWuu4Ab432dSDW78Ks8pJeZ1gi3nOrX8oi Dzsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eOJzseNB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si20049179pgl.181.2022.01.26.08.07.35; Wed, 26 Jan 2022 08:07:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eOJzseNB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236429AbiAZCac (ORCPT + 99 others); Tue, 25 Jan 2022 21:30:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236420AbiAZCab (ORCPT ); Tue, 25 Jan 2022 21:30:31 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8CE8C06161C; Tue, 25 Jan 2022 18:30:30 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id s5so35167443ejx.2; Tue, 25 Jan 2022 18:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x79rzXXTHBgOsXBjkeB1wHbZQHGb1pLifmwYG6i89Z4=; b=eOJzseNBdufi6hmKCoAY2brormzMtk1Dh5va9jpTk82VBmCbSQZO60H7e9r8UYMogA 2XNoGTxKxRQug+NObU1SenjgwP0CJ6ZkIuVLc7Zng2mCPMsuk9gv4o+nqG9qNY31oOrW JTZviKuI5vCDbCqCiW5JQGpYWuZFrRqhkoT4CIhMoh3ZoMUZpOSygkV0G1CLv22nWjKu tMnaps4LrWqUrkXHuxbKsbXG4f6BCgXBmkjzW5SfpHkkQ5xHg9c+UmhMNSdtTkAY6UHm 2TPXlolrgcm4SrjrL7y5as5t+On76F8xk2Yv1JmQcYZOg3+36qVcVUBRjyEHuhtnICy+ zepA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x79rzXXTHBgOsXBjkeB1wHbZQHGb1pLifmwYG6i89Z4=; b=AwZ9m0zShd1jIPWuXylyl0q5wNcIom2evfcwWxl+dfV+1qorE5NG/nvktI22bHv3o9 pSqmCmnIkpDJGTqAtw4W7TjwfhxkWdkH1nQUayj85iWPBJ6P8os4lGodeUsua0jbvYwI aHy/dvrqpZvqhK52ixRWGm8/wdwzshz6Eu25EfF88A81TNSCMaXdzwZz5jBMJImVUl8H 4+wBEqNG2OATzUr/egxfCGPRXNqxj17SzQkT3yjzvp4qkdFY7uL+k2yYNIxBmotk2If7 v3OjmYNtfqiVxKJRqHLQ4OoHUrIXJwBEKTtACONuoIM2jo8NnonG+tJ1qxFFGC3bDgSU XEqQ== X-Gm-Message-State: AOAM532UBvBYJe9xELD0oHsOJbS/0XgtYmPtjaSiLCrU9ZGNy4GLCgb4 Y8wEJhmfsQIIMaE3exiVp1i4xu4JkYdtrrd3e1Q= X-Received: by 2002:a17:907:3f24:: with SMTP id hq36mr15796903ejc.439.1643164229255; Tue, 25 Jan 2022 18:30:29 -0800 (PST) MIME-Version: 1.0 References: <20220124131538.1453657-1-imagedong@tencent.com> <20220124131538.1453657-3-imagedong@tencent.com> In-Reply-To: From: Menglong Dong Date: Wed, 26 Jan 2022 10:26:00 +0800 Message-ID: Subject: Re: [PATCH net-next 2/6] net: ipv4: use kfree_skb_reason() in ip_rcv_core() To: David Ahern Cc: Jakub Kicinski , Steven Rostedt , mingo@redhat.com, David Miller , Hideaki YOSHIFUJI , David Ahern , pablo@netfilter.org, kadlec@netfilter.org, Florian Westphal , Menglong Dong , Eric Dumazet , alobakin@pm.me, paulb@nvidia.com, Paolo Abeni , talalahmad@google.com, haokexin@gmail.com, Kees Cook , memxor@gmail.com, LKML , netdev , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Cong Wang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 10:10 AM David Ahern wrote: > > On 1/24/22 6:15 AM, menglong8.dong@gmail.com wrote: > > @@ -478,7 +483,7 @@ static struct sk_buff *ip_rcv_core(struct sk_buff *skb, struct net *net) > > IPSTATS_MIB_NOECTPKTS + (iph->tos & INET_ECN_MASK), > > max_t(unsigned short, 1, skb_shinfo(skb)->gso_segs)); > > > > - if (!pskb_may_pull(skb, iph->ihl*4)) > > + if (!pskb_may_pull(skb, iph->ihl * 4)) > > unrelated cleanup > Haha, you got me :/ > > goto inhdr_error; > > > > iph = ip_hdr(skb); > > @@ -490,7 +495,7 @@ static struct sk_buff *ip_rcv_core(struct sk_buff *skb, struct net *net) > > if (skb->len < len) { > > __IP_INC_STATS(net, IPSTATS_MIB_INTRUNCATEDPKTS); > > goto drop; > > - } else if (len < (iph->ihl*4)) > > + } else if (len < (iph->ihl * 4)) > > ditto > > > goto inhdr_error; > > > > /* Our transport medium may have padded the buffer out. Now we know it >