In the Linux kernel, the following vulnerability has been resolved:
vxlan: reject dynamic fdb entries that reference a nexthop id
The commit cited in the Fixes tag allowed VXLAN FDB entries to point to
FDB nexthops so that overlay traffic could be load balanced across
multiple VTEPs. Such entries can only be configured from user space,
cannot be learned and cannot roam. They only make sense with a user space
control plane such as E-VPN where data plane learning is disabled.
Despite that, the VXLAN driver does not currently prevent such entries
from being configured with the "dynamic" flag. The per-nexthop FDB list
is only protected by the per-device hash lock, which is not sufficient
when two VXLAN devices point to the same FDB nexthop and therefore share
the list. Aging runs in softirq context without RTNL, so an entry deleted
by one device can race with an addition or deletion from the other,
leading to list corruption:
list_del corruption. next->prev should be ffff8881069d9548, but was
dead000000000122. (next=ffff8881069d9448)
WARNING: CPU: 0 PID: 90 at lib/list_debug.c:65
__list_del_entry_valid_or_report+0x1aa/0x210
...
vxlan_fdb_destroy+0x5b8/0xad0
vxlan_cleanup+0x328/0x450
call_timer_fn+0x2a/0x1c0
run_timer_softirq+0x18c/0x210
BUG: KASAN: slab-use-after-free in vxlan_fdb_destroy
Fix this by rejecting the bogus configuration of dynamic FDB entries that
point to FDB nexthops, both when created and when an existing entry is
updated. As such, the per-nexthop FDB list is only ever mutated under the
RTNL lock. Add test cases to make sure that this does not regress in the
future.
CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.8
AV:L - The bad state is a dynamic VXLAN FDB entry referencing an FDB nexthop id, installed via local rtnetlink RTM_NEWNEIGH -> rtnl_fdb_add -> vxlan_fdb_add (with RTM_NEWNEXTHOP/RTM_NEWLINK setup). Nexthop FDB entries are never learned from received packets, so no remote peer supplies the input.
AC:L - The attacker creates both vxlan devices sharing one nexthop group, sets a short ageing interval, and races vxlan_cleanup() timer-driven vxlan_fdb_destroy() on one device against fdb add/delete on the other; they control both sides and can retry in a loop.
PR:L - rtnetlink_rcv_msg only requires netlink_net_capable(CAP_NET_ADMIN) in the netns's user_ns, so an unprivileged user can create vxlan devices, nexthops and FDB entries inside an unshare -Urn namespace.
UI:N - No victim action is needed; the attacker drives every netlink request and the ageing timer fires by itself.
S:U - Corruption stays inside the kernel's own memory; this is a standard kernel privilege escalation or crash with no crossing into a separate security authority.
C:H - Unsynchronized list_del_rcu/list_add_tail_rcu on the shared nh->fdb_list corrupts the list and leaves pointers to vxlan_fdb objects freed by call_rcu (KASAN slab-use-after-free in vxlan_fdb_destroy), which can be groomed into a kernel read primitive.
I:H - List unlink/link through dangling nh_list pointers writes to freed and reallocated slab objects, giving a heap write primitive that can be used for control-flow hijack.
A:H - The race produces list_del corruption and use-after-free in vxlan_fdb_destroy from timer softirq, which crashes the kernel (BUG/oops/panic on panic_on_warn).
| Attack Vector |
Local |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The bad state is a dynamic VXLAN FDB entry referencing an FDB nexthop id, installed via local rtnetlink RTM_NEWNEIGH -> rtnl_fdb_add -> vxlan_fdb_add (with RTM_NEWNEXTHOP/RTM_NEWLINK setup). Nexthop FDB entries are never learned from received packets, so no remote peer supplies the input.
AC:L - The attacker creates both vxlan devices sharing one nexthop group, sets a short ageing interval, and races vxlan_cleanup() timer-driven vxlan_fdb_destroy() on one device against fdb add/delete on the other; they control both sides and can retry in a loop.
PR:L - rtnetlink_rcv_msg only requires netlink_net_capable(CAP_NET_ADMIN) in the netns's user_ns, so an unprivileged user can create vxlan devices, nexthops and FDB entries inside an unshare -Urn namespace.
UI:N - No victim action is needed; the attacker drives every netlink request and the ageing timer fires by itself.
S:U - Corruption stays inside the kernel's own memory; this is a standard kernel privilege escalation or crash with no crossing into a separate security authority.
C:H - Unsynchronized list_del_rcu/list_add_tail_rcu on the shared nh->fdb_list corrupts the list and leaves pointers to vxlan_fdb objects freed by call_rcu (KASAN slab-use-after-free in vxlan_fdb_destroy), which can be groomed into a kernel read primitive.
I:H - List unlink/link through dangling nh_list pointers writes to freed and reallocated slab objects, giving a heap write primitive that can be used for control-flow hijack.
A:H - The race produces list_del corruption and use-after-free in vxlan_fdb_destroy from timer softirq, which crashes the kernel (BUG/oops/panic on panic_on_warn).
CVSS 3.1