From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, nhorman@tuxdriver.com, matttbe@kernel.org,
martineau@kernel.org, yotam.gi@gmail.com, jiri@resnulli.us,
jacob.e.keller@intel.com, johannes@sipsolutions.net,
fw@strlen.de
Subject: Re: [PATCH net-next] genetlink: Use internal flags for multicast groups
Date: Mon, 18 Dec 2023 13:37:41 +0200 [thread overview]
Message-ID: <ZYAvBdhiAnR9dIi3@smile.fi.intel.com> (raw)
In-Reply-To: <20231217075348.4040051-1-idosch@nvidia.com>
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
next prev parent reply other threads:[~2023-12-18 11:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-17 7:53 [PATCH net-next] genetlink: Use internal flags for multicast groups Ido Schimmel
2023-12-18 11:37 ` Andy Shevchenko [this message]
2023-12-18 16:31 ` Ido Schimmel
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=ZYAvBdhiAnR9dIi3@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=idosch@nvidia.com \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=pabeni@redhat.com \
--cc=yotam.gi@gmail.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).