]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Merge branch 'vxlan-geneve-require-cap_net_admin-in-the-device-netns-for-changelink'
authorJakub Kicinski <kuba@kernel.org>
Thu, 23 Jul 2026 15:17:10 +0000 (08:17 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 23 Jul 2026 15:17:10 +0000 (08:17 -0700)
commit9857fc06eb6f7eef3526691ee8f9358ce55ae676
treee845bb1f7a1a001128f822f73d8569df39d6a1eb
parentfd3a3f28ed60c6af4b2a39933b151d6b27842c3b
parent8efb8f8bbb353b8f2fdf4f37534c6d96c9f69e01
Merge branch 'vxlan-geneve-require-cap_net_admin-in-the-device-netns-for-changelink'

Doruk Tan Ozturk says:

====================
vxlan, geneve: require CAP_NET_ADMIN in the device netns for changelink

The recent series "require CAP_NET_ADMIN in the device netns for
changelink" (8165f7ff57d9..27ccb68e7ccc) added rtnl_dev_link_net_capable()
and gated the eight IP tunnel drivers (ip_gre, ipip, ip_vti, ip6_tunnel,
ip6_gre, ip6_vti, sit, xfrm_interface). VXLAN and GENEVE share the exact
same shape but were not covered: both store the underlay netns sticky at
newlink (vxlan->net / geneve->net) and their changelink() operates on that
netns, while the generic RTM_NEWLINK path only checks CAP_NET_ADMIN against
dev_net(dev). Once such a device is created in or moved to another netns,
a caller privileged in dev_net(dev) but not in the underlay netns can
reconfigure the tunnel'"'"'s underlay.

This completes that series for the two UDP tunnel drivers that were left
out. Same helper, same placement (top of changelink, before any attribute
is parsed).

Verified on next-20260714 in QEMU with CONFIG_VXLAN=y + CONFIG_USER_NS=y:
an unprivileged user namespace holding CAP_NET_ADMIN only in a child netns
issues an IFLA_INFO_DATA changelink on a vxlan device whose underlay lives
in init_net. Before: returns 0 (reconfigures the init_net underlay).
After: returns -EPERM.
====================

Link: https://patch.msgid.link/20260716203500.70573-1-doruk@0sec.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>