Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5222823pxb; Wed, 26 Jan 2022 07:22:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOnFSHvqDryErnvS1lzaaNER3f0LqaPilOd0uJHvd9xM7kRKD7D11QLpVlpz1gT7XzW68K X-Received: by 2002:a17:902:a50f:b0:149:bc1a:2c98 with SMTP id s15-20020a170902a50f00b00149bc1a2c98mr23612842plq.35.1643210560773; Wed, 26 Jan 2022 07:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643210560; cv=none; d=google.com; s=arc-20160816; b=SjlP32p5spPp7T5ET8DJBis36Ax2U+gC1G8t3fcod7hFQ0sPAKm4sAqmkz2Q5RIiFV cbJWPE4jm1KXCjk/czheqGEeS4+VvnqCQcmO4a9xwA8x38uvn/TxxeJZjQwqjUpFgMf8 +2R4BbAb7Ihh3YU/Dnzigqtf4zFxnhD2JZAPdEe5esvwiwFMj8vS8NKq0AGS3LiYJJi6 Qscwp3Geuy3UufBHDA9gup0OObzcRXW4s+xH8Vt2x2Bu6Lx0lGKENHoJB7rpbHKICW3z XaeLiAvFtgl8yP0YRDRb95Ykb6k4CkmW5cwAbxWXi5V9JiewxM5WuW3IY0W8RPU62Zzw lVpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0H9aOk8QYoiNSHNr3RfzkCP3wW9BTsxs9UCx1zYQcCY=; b=W+Ddoul9eB2wOPgvzHeCxia4YOJMg0xQbm9+tDojI20lwPrUZHhEvqlujV7g26Yt9O bKRrCc8fjrZdst1lR7IDGivBsvU0TVgMthEwS+cVOSeNuYjZd4e752GFUXAerY9dZlT2 jyrDQBT6EF99HKC3FY9mGN4VNnR9+NUCowEfZYjBOIYBKjTi6RJzLcl7YzCrTxYIgQXl z9Vhr0WygAoZKO2O7k2ntVNP1AEgXppluR0UD828x2o4NUuNoXJDz32u+SBM/YqRBHQX +0S0KEzWHjZkilU+6T4mKnB8SPMxXTw79mYiwTPXU3+qDwqKzerNcIZrdQwLJKzP67BN MKfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BS9htBOB; 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 u14si1845033pfi.314.2022.01.26.07.22.27; Wed, 26 Jan 2022 07:22:40 -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=BS9htBOB; 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 S236142AbiAZCKs (ORCPT + 99 others); Tue, 25 Jan 2022 21:10:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233572AbiAZCKp (ORCPT ); Tue, 25 Jan 2022 21:10:45 -0500 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9D13C06161C; Tue, 25 Jan 2022 18:10:45 -0800 (PST) Received: by mail-io1-xd30.google.com with SMTP id e79so25971290iof.13; Tue, 25 Jan 2022 18:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=0H9aOk8QYoiNSHNr3RfzkCP3wW9BTsxs9UCx1zYQcCY=; b=BS9htBOBXR7UCNQZ6l6e/ME0oV3SbLxazRfCdy0Dlw9n09qPf+h2QFaqJdv4U+XgEk k6R5Y3ZWMQ5W9JcAQmkFC0AbG+sw7pTEHh3Zs4LbEBpBJnQ+3pdCPipAIClWH9siak7J /gxbSEbcrLB7u5pcGnGjlrpPr1GiYO6fVRv7f06P1yEmT3qNnmRqMQleSCJnmHy3rY0k CHKmPf0K3mZA5uc0Pd2h7i/3Bz0Hrfe0ta+kf2SYXVT3wh9l+8n3NxFJ2kfxxEKOcCFL gbq1t/bsTpSQt3gDNuYQxvMKnDEeyfWbAF/kxvEvthS49mOv/k6RvlIzwO5UOZUNr6fc 0BTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=0H9aOk8QYoiNSHNr3RfzkCP3wW9BTsxs9UCx1zYQcCY=; b=PQD5giH97eAZwC6fZq6iuKAMNPBhk2Aq7ZFXeVUs8sbwVqc0r5bYiiooDfNcAIpo2G BLrg5ndE/z2PlzAA4TUM2JIp32YsF1b7bJsLAs+PLy/kTX+cUYG7Iqkl4outRsOQSH9C tnte6Gcn4kx8pZhzjQUG0evMKWvRytWNHuWbaUproKaJezfyfKE+wCinTtW2wautl/cu k+wvohR4NDIqGdi7XAv69Z7VrWdNgLM+QItyXmSDlu5GWVqwhrFCEHCaXQvoomLKM+4v UobLAm+yQZIcB4BfANzKM6KrX/jQHF5MFRp3XCzP9/xmEPMgK4Sj72kZez8r++YEVICD VJ/A== X-Gm-Message-State: AOAM531ZNr+h26CBedMgXv33H9eV/OSZ/o1YZCk8SHNjSiZuhmpcZf9H 0w+tgcZdf2JmmD7M3E9CUbQ= X-Received: by 2002:a02:a155:: with SMTP id m21mr9864184jah.0.1643163045006; Tue, 25 Jan 2022 18:10:45 -0800 (PST) Received: from ?IPV6:2601:282:800:dc80:1502:2fac:6dee:881? ([2601:282:800:dc80:1502:2fac:6dee:881]) by smtp.googlemail.com with ESMTPSA id f13sm8666626ion.18.2022.01.25.18.10.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jan 2022 18:10:44 -0800 (PST) Message-ID: Date: Tue, 25 Jan 2022 19:10:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH net-next 2/6] net: ipv4: use kfree_skb_reason() in ip_rcv_core() Content-Language: en-US To: menglong8.dong@gmail.com, kuba@kernel.org Cc: rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de, imagedong@tencent.com, edumazet@google.com, alobakin@pm.me, paulb@nvidia.com, pabeni@redhat.com, talalahmad@google.com, haokexin@gmail.com, keescook@chromium.org, memxor@gmail.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, cong.wang@bytedance.com References: <20220124131538.1453657-1-imagedong@tencent.com> <20220124131538.1453657-3-imagedong@tencent.com> From: David Ahern In-Reply-To: <20220124131538.1453657-3-imagedong@tencent.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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