mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	Pavel Emelyanov <xemul@openvz.org>,
	Eric Dumazet <dada1@cosmosbay.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH net-next] sock: Correct error checking condition for assign|release_proto_idx()
Date: Thu, 10 Apr 2025 08:52:29 +0800	[thread overview]
Message-ID: <2e4fa39d-3d1d-4336-af99-4ecdf8a9482f@icloud.com> (raw)
In-Reply-To: <CANn89iKP-5hy-oMuYwEvwFOzzAkfF5=8v7patSE5z7PZQS0V2Q@mail.gmail.com>

On 2025/4/9 03:06, Eric Dumazet wrote:
>>  {
>> -       this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val);
>> +       unsigned int idx = prot->inuse_idx;
>> +
>> +       if (likely(idx < PROTO_INUSE_NR))
>> +               this_cpu_add(net->core.prot_inuse->val[idx], val);
>>  }
> I do not think we are going to add such a test in the fast path, for a
> bug that can not happen.
> 

agree.

> Please give us a reproducer ?

will remove that check in v2 provided @prot->inuse_idx will never be
used if @prot fails to be registered.

thank you for code review.

      reply	other threads:[~2025-04-10  0:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 13:42 Zijun Hu
2025-04-08 18:21 ` Kuniyuki Iwashima
2025-04-10  0:50   ` Zijun Hu
2025-04-08 19:06 ` Eric Dumazet
2025-04-10  0:52   ` Zijun Hu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e4fa39d-3d1d-4336-af99-4ecdf8a9482f@icloud.com \
    --to=zijun_hu@icloud.com \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_zijuhu@quicinc.com \
    --cc=willemb@google.com \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®