[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <677d8f3618080_2821742942a@willemb.c.googlers.com.notmuch>
Date: Tue, 07 Jan 2025 15:31:50 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: davem@...emloft.net,
netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
stable@...r.kernel.org,
jdamato@...tly.com,
almasrymina@...gle.com,
amritha.nambiar@...el.com,
sridhar.samudrala@...el.com
Subject: Re: [PATCH net] netdev: prevent accessing NAPI instances from another
namespace
Jakub Kicinski wrote:
> On Tue, 07 Jan 2025 08:10:36 -0500 Willem de Bruijn wrote:
> > > +/* must be called under rcu_read_lock(), as we dont take a reference */
> >
> > Instead of function comments, invariant checks in code?
> >
> > Like in dev_get_by_napi_id:
> >
> > WARN_ON_ONCE(!rcu_read_lock_held());
>
> Can I do it as a follow up? Adding the warning to napi_by_id()
> reveals that napi_hash_add() currently walks the list without
> holding the RCU lock :)
Ah I should have noticed that :) Of course, or ignore in this case
then.
Powered by blists - more mailing lists