[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYAvBdhiAnR9dIi3@smile.fi.intel.com>
Date: Mon, 18 Dec 2023 13:37:41 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ido Schimmel <idosch@...dia.com>
Cc: netdev@...r.kernel.org, mptcp@...ts.linux.dev, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com,
nhorman@...driver.com, matttbe@...nel.org, martineau@...nel.org,
yotam.gi@...il.com, jiri@...nulli.us, jacob.e.keller@...el.com,
johannes@...solutions.net, fw@...len.de
Subject: Re: [PATCH net-next] genetlink: Use internal flags for multicast
groups
On Sun, Dec 17, 2023 at 09:53:48AM +0200, Ido Schimmel wrote:
> As explained in commit e03781879a0d ("drop_monitor: Require
> 'CAP_SYS_ADMIN' when joining "events" group"), the "flags" field in the
> multicast group structure reuses uAPI flags despite the field not being
> exposed to user space. This makes it impossible to extend its use
> without adding new uAPI flags, which is inappropriate for internal
> kernel checks.
>
> Solve this by adding internal flags (i.e., "GENL_MCAST_*") and convert
> the existing users to use them instead of the uAPI flags.
>
> Tested using the reproducers in commit 44ec98ea5ea9 ("psample: Require
> 'CAP_NET_ADMIN' when joining "packets" group") and commit e03781879a0d
> ("drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group").
>
> No functional changes intended.
...
> +#define GENL_MCAST_CAP_NET_ADMIN BIT(0)
> +#define GENL_MCAST_CAP_SYS_ADMIN BIT(1)
> +
> /**
> * struct genl_multicast_group - generic netlink multicast group
> * @name: name of the multicast group, names are per-family
> - * @flags: GENL_* flags (%GENL_ADMIN_PERM or %GENL_UNS_ADMIN_PERM)
> - * @cap_sys_admin: whether %CAP_SYS_ADMIN is required for binding
> + * @flags: GENL_MCAST_* flags
> */
No functional, but documentation changes...
So, I suggest to have these flags being described
/* ... */
#define FLAG1
/* ... */
#define FLAG2
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists