From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
edumazet@google.com, jacob.e.keller@intel.com, jhs@mojatatu.com,
johannes@sipsolutions.net, andriy.shevchenko@linux.intel.com,
amritha.nambiar@intel.com, sdf@google.com, horms@kernel.org,
przemyslaw.kitszel@intel.com
Subject: Re: [patch net-next v5 5/9] genetlink: introduce per-sock family private storage
Date: Fri, 8 Dec 2023 15:21:52 +0100 [thread overview]
Message-ID: <ZXMmgJHPdBUFlROg@nanopsycho> (raw)
In-Reply-To: <20231207185526.5e59ab53@kernel.org>
Fri, Dec 08, 2023 at 03:55:26AM CET, kuba@kernel.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;
>> +}
[...]
next prev parent reply other threads:[~2023-12-08 14:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 18:21 [patch net-next v5 0/9] devlink: introduce notifications filtering Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 1/9] devlink: use devl_is_registered() helper instead xa_get_mark() Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 2/9] devlink: introduce __devl_is_registered() helper and use it instead of xa_get_mark() Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 3/9] devlink: send notifications only if there are listeners Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 4/9] devlink: introduce a helper for netlink multicast send Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 5/9] genetlink: introduce per-sock family private storage Jiri Pirko
2023-12-08 2:55 ` Jakub Kicinski
2023-12-08 10:07 ` Jiri Pirko
2023-12-08 14:21 ` Jiri Pirko [this message]
2023-12-08 16:11 ` Jakub Kicinski
2023-12-09 10:36 ` Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 6/9] netlink: introduce typedef for filter function Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 7/9] genetlink: introduce helpers to do filtered multicast Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 8/9] devlink: add a command to set notification filter and use it for multicasts Jiri Pirko
2023-12-06 18:21 ` [patch net-next v5 9/9] devlink: extend multicast filtering by port index Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZXMmgJHPdBUFlROg@nanopsycho \
--to=jiri@resnulli.us \
--cc=amritha.nambiar@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jhs@mojatatu.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).