linux/drivers/net/vxlan
Doruk Tan Ozturk 3a61bd9637 vxlan: require CAP_NET_ADMIN in the device netns for changelink
A tunnel changelink() operates on at most two netns, dev_net(dev) and
the sticky underlay netns vxlan->net. They differ once the device is
created in or moved to a netns other than the one the request runs in.
The rtnl changelink path checks CAP_NET_ADMIN only against dev_net(dev),
so a caller privileged there but not in vxlan->net can rewrite a vxlan
device whose underlay lives in vxlan->net.

vxlan_changelink() validates and applies the new configuration against
vxlan->net (vxlan_config_validate(vxlan->net, ...)) and can reopen the
underlay socket in that netns, so the same reasoning as the tunnel
changelink series applies here.

Gate vxlan_changelink() with rtnl_dev_link_net_capable(), at the top of
the op before any attribute is parsed, matching ipgre_changelink() and
the rest of the "require CAP_NET_ADMIN in the device netns for
changelink" series.

Found by 0sec automated security-research tooling (https://0sec.ai).

Fixes: 8bcdc4f3a2 ("vxlan: add changelink support")
Cc: stable@vger.kernel.org
Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260716203500.70573-2-doruk@0sec.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-23 08:17:08 -07:00
..
Makefile vxlan: mdb: Add MDB control path support 2023-03-17 08:05:49 +00:00
vxlan_core.c vxlan: require CAP_NET_ADMIN in the device netns for changelink 2026-07-23 08:17:08 -07:00
vxlan_mdb.c vxlan: mdb: Fix source list corruption on a failed replace 2026-07-22 13:11:38 -07:00
vxlan_multicast.c vxlan: Store struct sock in struct vxlan_sock. 2026-05-05 17:47:04 -07:00
vxlan_private.h vxlan: Remove unused declarations eth_vni_hash() and fdb_head_index() 2025-11-13 17:20:54 -08:00
vxlan_vnifilter.c vxlan: vnifilter: fix spurious notification on VNI update 2026-06-04 08:47:45 -07:00