Re: [PATCH net-next 1/2] netconsole: publish the userdata payload with RCU

Breno Leitao <[email protected]> Wed, 5 Aug 2026 02:56:30 -0700
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On Tue, Aug 04, 2026 at 06:09:44PM +0100, Gustavo Luiz Duarte wrote:
> > @@ -176,8 +190,7 @@ struct netconsole_target {
> >  #ifdef CONFIG_NETCONSOLE_DYNAMIC
> >         struct config_group     group;
> >         struct config_group     userdata_group;
> > -       char                    *userdata;
> > -       size_t                  userdata_length;
> > +       struct netcons_userdata __rcu *userdata;
> 
> With userdata now annotated with __rcu, it should be freed with
> kfree(rcu_access_pointer(nt->userdata)) to avoid a sparse warning:

Good catch, thanks. I will fix in v2 in both netconsole_target_release()
and free_param_target().

I willthe plain kfree() instead of kfree_rcu(): both callers free nt
itself on the next line, and the target is already unlinked from
target_list at that point, so the payload cannot outlive the target.

Thanks for the review,
--breno