Thread (16 messages) 16 messages, 3 authors, 2023-04-01

Re: [PATCH v1 2/5] connector/cn_proc: Add filtering to fix some bugs

From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-03-15 04:59:55
Also in: lkml

On Tue, 14 Mar 2023 02:32:13 +0000 Anjali Kulkarni wrote:
This is clearly a layering violation, right?
Please don't add "if (family_x)" to the core netlink code.

ANJALI> Yes, it is, but there does not seem a very clean way to do it
ANJALI> otherwise and I saw a check for protocol NETLINK_GENERIC just
ANJALI> below it, so used it for connector as well. There is no
ANJALI> release or free callback in the netlink_sock. Is it ok to add
ANJALI> it? There was another bug (for which I have not yet sent a
ANJALI> patch) in which, we need to decrement
ANJALI> proc_event_num_listeners, when client exits without calling
ANJALI> IGNORE, else that count again gets out of status of actual no
ANJALI> of listeners.   
The other option is to add a flag in netlink_sock, something like
NETLINK_F_SK_USER_DATA_FREE, which will free the sk_user_data, if
this flag is set. But it does not solve the above scenario.
Please fix your email setup, it's really hard to read your replies.

There is an unbind callback, and a notifier. Can neither of those 
be made to work? ->sk_user_data is not a great choice of a field,
either, does any other netlink family use it this way?
Adding a new field for family use to struct netlink_sock may be better.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help