[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250801141424.4531c205@kernel.org>
Date: Fri, 1 Aug 2025 14:14:24 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: Eric Dumazet <edumazet@...gle.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
Breno Leitao <leitao@...ian.org>, Kuniyuki Iwashima <kuni1840@...il.com>,
netdev@...r.kernel.org,
syzbot+8aa80c6232008f7b957d@...kaller.appspotmail.com
Subject: Re: [PATCH v1 net] netdevsim: Fix wild pointer access in
nsim_queue_free().
On Fri, 1 Aug 2025 09:29:49 -0700 Kuniyuki Iwashima wrote:
> > > hrtimer_cancel(&rq->napi_timer);
> > > - local_bh_disable();
> > > - dev_dstats_rx_dropped_add(dev, rq->skb_queue.qlen);
> > > - local_bh_enable();
> > > +
> > > + if (likely(dev->reg_state != NETREG_UNINITIALIZED)) {
> >
> > I find this test about reg_state a bit fragile...
> >
> > I probably would have made dev_dstats_rx_dropped_add() a bit stronger,
> > it is not used in a fast path.
>
> I thought I should avoid local_bh_disable() too, but yes,
> it's unlikely and in the slow path.
>
> I'll use the blow diff in v2.
Option 2 :
if (rq->skb_queue.qlen)
dev_dstats_rx_dropped_add(dev, rq->skb_queue.qlen);
since there can't be any packets, yet. Up to you.
Powered by blists - more mailing lists