public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Ido Schimmel <idosch@nvidia.com>, <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <nhorman@tuxdriver.com>,
	<yotam.gi@gmail.com>, <jiri@resnulli.us>,
	<johannes@sipsolutions.net>, <horms@kernel.org>,
	<andriy.shevchenko@linux.intel.com>, <jhs@mojatatu.com>
Subject: Re: [PATCH net 2/2] drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group
Date: Wed, 6 Dec 2023 15:19:37 -0800	[thread overview]
Message-ID: <cc284e70-23c9-463a-8ac2-9a4df8e03374@intel.com> (raw)
In-Reply-To: <20231206213102.1824398-3-idosch@nvidia.com>



On 12/6/2023 1:31 PM, Ido Schimmel wrote:
> The "NET_DM" generic netlink family notifies drop locations over the
> "events" multicast group. This is problematic since by default generic
> netlink allows non-root users to listen to these notifications.
> 
> Fix by adding a new field to the generic netlink multicast group
> structure that when set prevents non-root users or root without the
> 'CAP_SYS_ADMIN' capability (in the user namespace owning the network
> namespace) from joining the group. Set this field for the "events"
> group. Use 'CAP_SYS_ADMIN' rather than 'CAP_NET_ADMIN' because of the
> nature of the information that is shared over this group.
> 
> Note that the capability check in this case will always be performed
> against the initial user namespace since the family is not netns aware
> and only operates in the initial network namespace.
> 
> A new field is added to the structure rather than using the "flags"
> field because the existing field uses uAPI flags and it is inappropriate
> to add a new uAPI flag for an internal kernel check. In net-next we can
> rework the "flags" field to use internal flags and fold the new field
> into it. But for now, in order to reduce the amount of changes, add a
> new field.
> 
> Since the information can only be consumed by root, mark the control
> plane operations that start and stop the tracing as root-only using the
> 'GENL_ADMIN_PERM' flag.
> 

Makes sense.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

  reply	other threads:[~2023-12-06 23:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 21:31 [PATCH net 0/2] Generic netlink multicast fixes Ido Schimmel
2023-12-06 21:31 ` [PATCH net 1/2] psample: Require 'CAP_NET_ADMIN' when joining "packets" group Ido Schimmel
2023-12-06 23:16   ` Jacob Keller
2023-12-07 10:16   ` Jamal Hadi Salim
2023-12-07 10:32     ` Jiri Pirko
2023-12-07 10:17   ` Jiri Pirko
2023-12-06 21:31 ` [PATCH net 2/2] drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group Ido Schimmel
2023-12-06 23:19   ` Jacob Keller [this message]
2023-12-07 10:17   ` Jiri Pirko
2023-12-07 18:00 ` [PATCH net 0/2] Generic netlink multicast fixes patchwork-bot+netdevbpf

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=cc284e70-23c9-463a-8ac2-9a4df8e03374@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --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