From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Anil Kaushik <anilkaushikwireless@gmail.com>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Harald Welte <laforge@gnumonks.org>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Simon Horman <horms@kernel.org>,
osmocom-net-gprs@lists.osmocom.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] gtp: Require 'CAP_NET_ADMIN' when joining the gtp multicast group
Date: Tue, 27 Oct 2026 09:48:00 +0100 [thread overview]
Message-ID: <89f607a9-c353-4a32-9362-1a5017b580ab@6wind.com> (raw)
In-Reply-To: <20261023073738.2436362-1-anilkaushikwireless@gmail.com>
Le 23/10/2026 à 09:37, Anil Kaushik a écrit :
> The gtp generic netlink family sends notifications on its "gtp"
> multicast group when a PDP context is added or deleted, and for GTP-U
> echo responses. They carry the same attributes as a GETPDP reply: the
> MS and peer addresses, and the TEIDs, or the TID and the flow label.
>
> GETPDP requires CAP_NET_ADMIN, but generic netlink lets any user join a
> multicast group by default, so an unprivileged user in the network
> namespace of the gtp device can read all of this. Found by code
> inspection.
>
> Fix by marking the group with GENL_MCAST_CAP_NET_ADMIN, like the psample
> "packets" group. Only users with CAP_NET_ADMIN in the user namespace
> owning the network namespace can then join it.
>
> This is still weaker than the check on GETPDP, which needs
> CAP_NET_ADMIN in the initial user namespace: in a network namespace
> owned by another user namespace, its root can join the group, but not
> use GETPDP. Genetlink has no multicast group flag for the initial user
> namespace, and ioam6 pairs its ops and its group the same way. This fix
> blocks the unprivileged users.
>
> Tested by joining the group as root, as root without CAP_NET_ADMIN, and
> as an unprivileged user:
>
> Before:
> root: joined
> root without CAP_NET_ADMIN: joined
> nobody: joined
>
> After:
> root: joined
> root without CAP_NET_ADMIN: EPERM
> nobody: EPERM
>
> Fixes: 50aba46c234e ("gtp: add notification mechanism")
> Signed-off-by: Anil Kaushik <anilkaushikwireless@gmail.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
next prev parent reply other threads:[~2026-10-27 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 7:37 Anil Kaushik
2026-10-27 8:48 ` Nicolas Dichtel [this message]
2026-10-27 12:13 ` Paolo Abeni
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=89f607a9-c353-4a32-9362-1a5017b580ab@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=andrew+netdev@lunn.ch \
--cc=anilkaushikwireless@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=laforge@gnumonks.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=osmocom-net-gprs@lists.osmocom.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
/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
all inboxes | Powered by JetHome®