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

Breno Leitao <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.