[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250107083609.55ddf0d6@kernel.org>
Date: Tue, 7 Jan 2025 08:36:09 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: 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
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 :)
Powered by blists - more mailing lists