summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorAnil Kaushik <anilkaushikwireless@gmail.com>2026-10-27 13:06:23 +0000
committerPaolo Abeni <pabeni@redhat.com>2026-10-29 15:14:50 +0100
commitdb627e71b6da4416324a2eb599d12fa96959d478 (patch)
tree4a8784c708e541d010f00e14eaab70b61f09f346 /scripts/basic/split-include.c
parentd7314b51341c037973ce022f12c6009fd07b021e (diff)
downloadlinux-db627e71b6da4416324a2eb599d12fa96959d478.tar.gz
linux-db627e71b6da4416324a2eb599d12fa96959d478.zip
gtp: Require 'CAP_NET_ADMIN' when joining the gtp multicast group
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, and with uns-admin-perm in the gtp netlink spec. 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") Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Anil Kaushik <anilkaushikwireless@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20261027130623.3136658-1-anilkaushikwireless@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions