From: Jakub Kicinski <kuba@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
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 08:11:23 -0800 [thread overview]
Message-ID: <20231208081123.448e4c5b@kernel.org> (raw)
In-Reply-To: <ZXMmgJHPdBUFlROg@nanopsycho>
On Fri, 8 Dec 2023 15:21:52 +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?
When family gets removed all subs must be cleared. So the user
sock will have to resolve the mcast ID again, and re-subscribe
again to get any notification. Having to re-sub implies having
to re-add filters in my mind.
next prev parent reply other threads:[~2023-12-08 16:11 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
2023-12-08 16:11 ` Jakub Kicinski [this message]
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=20231208081123.448e4c5b@kernel.org \
--to=kuba@kernel.org \
--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=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--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).