[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXMmgJHPdBUFlROg@nanopsycho>
Date: Fri, 8 Dec 2023 15:21:52 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, pabeni@...hat.com, davem@...emloft.net,
edumazet@...gle.com, jacob.e.keller@...el.com, jhs@...atatu.com,
johannes@...solutions.net, andriy.shevchenko@...ux.intel.com,
amritha.nambiar@...el.com, sdf@...gle.com, horms@...nel.org,
przemyslaw.kitszel@...el.com
Subject: Re: [patch net-next v5 5/9] genetlink: introduce per-sock family
private storage
Fri, Dec 08, 2023 at 03:55:26AM CET, kuba@...nel.org wrote:
>On Wed, 6 Dec 2023 19:21:16 +0100 Jiri Pirko wrote:
[...]
>> +static struct genl_sk_priv *genl_sk_priv_alloc(struct genl_family *family)
>> +{
>> + struct genl_sk_priv *priv;
>> +
>> + priv = kzalloc(size_add(sizeof(*priv), family->sock_priv_size),
>> + GFP_KERNEL);
>> + if (!priv)
>> + return ERR_PTR(-ENOMEM);
>> + priv->destructor = family->sock_priv_destroy;
>
>family->sock_priv_destroy may be in module memory.
>I think you need to wipe them when family goes :(
Crap. That's a bit problematic. Family can unregister and register
again, with user having the same sock sill opened with legitimate
expectation of filter being applied. Don't see now how to handle this
other then no-destroy and just kfree here in genetlink.c :/ Going back
to v4?
>
>> + if (family->sock_priv_init)
>> + family->sock_priv_init(priv->priv);
>> + return priv;
>> +}
[...]
Powered by blists - more mailing lists