vxlan: require CAP_NET_ADMIN in the device netns for changelink
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8bcdc4f3a20be949df54b67e5ae2734daabb5792 · < 730c7e5fea7f06e0cdf21c547222ec93234fd1d6| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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).
From the CVE record · Linux
The Linux kernel's VXLAN changelink operation does not check CAP_NET_ADMIN in the tunnel's underlay network namespace. A local caller with CAP_NET_ADMIN in the device's network namespace, but not the underlay namespace, can change the VXLAN device's configuration when those namespaces differ. No user interaction is described.
Engineers running Linux kernels with VXLAN support should check their kernel vendor's advisory for affected versions; none are specified here.