data built 2026-10-19T13:16:53Z

Look up another CVE · open CVE-2024-46678 in the interactive tracker

CVE-2024-46678

bonding: change ipsec_lock from spin lock to mutex

7.8 EPSS 0.2% AV:L

Published 2024-09-13 (2 years ago) by the Linux kernel CNA. Subsystem drivers/net. Debian urgency: not yet assigned.

What to do, per Debian release

Debian's own status for CVE-2024-46678 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source

ReleaseStatus VersionWhat this means
Debian 12bookwormvulnerable6.1.190-1No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication.
Debian 13trixiefixed6.10.9-1Update the kernel and reboot. Fixed in 6.10.9-1. A running kernel keeps the old code until the machine restarts.
Debian 14forkyfixed6.10.9-1Update the kernel and reboot. Fixed in 6.10.9-1. A running kernel keeps the old code until the machine restarts.
Debian unstablesidfixed6.10.9-1Update the kernel and reboot. Fixed in 6.10.9-1. A running kernel keeps the old code until the machine restarts.

The vulnerability

What the bug is

In the cited commit, bond->ipsec_lock is added to protect ipsec_list, hence xdo_dev_state_add and xdo_dev_state_delete are called inside this lock. As ipsec_lock is a spin lock and such xfrmdev ops may sleep, "scheduling while atomic" will be triggered when changing bond's active slave. [ 101.055189] BUG: scheduling while atomic: bash/902/0x00000200 [ 101.055726] Modules linked in: [ 101.058211] CPU: 3 PID: 902 Comm: bash Not tainted 6.9.0-rc4+ #1 [ 101.058760] Hardware name: [ 101.059434] Call Trace: [ 101.059436] <TASK> [ 101.060873] dump_stack_lvl+0x51/0x60 [ 101.061275] __schedule_bug+0x4e/0x60 [ 101.061682] __schedule+0x612/0x7c0 [ 101.062078] ? __mod_timer+0x25c/0x370 [ 101.062486] schedule+0x25/0xd0 [ 101.062845] schedule_timeout+0x77/0xf0 [ 101.063265] ? asm_common_interrupt+0x22/0x40 [ 101.063724] ? __bpf_trace_itimer_state+0x10/0x10 [ 101.064215] __wait_for_common+0x87/0x190 [ 101.064648] ? usleep_range_state+0x90/0x90 [ 101.065091] cmd_exec+0x437/0xb20 [mlx5_core] [ 101.065569] mlx5_cmd_do+0x1e/0x40 [mlx5_core] [ 101.066051] mlx5_cmd_exec+0x18/0x30 [mlx5_core] [ 101.066552] mlx5_crypto_create_dek_key+0xea/0x120 [mlx5_core] [ 101.067163] ? bonding_sysfs_store_option+0x4d/0x80 [bonding] [ 101.067738] ? kmalloc_trace+0x4d/0x350 [ 101.068156] mlx5_ipsec_create_sa_ctx+0x33/0x100 [mlx5_core] [ 101.068747] mlx5e_xfrm_add_state+0x47b/0xaa0 [mlx5_core] [ 101.069312] bond_change_active_slave+0x392/0x900 [bonding] [ 101.069868] bond_option_active_slave_set+0x1c2/0x240 [bonding] [ 101.070454] __bond_opt_set+0xa6/0x430 [bonding] [ 101.070935] __bond_opt_set_notify+0x2f/0x90 [bonding] [ 101.071453] bond_opt_tryset_rtnl+0x72/0xb0 [bonding] [ 101.071965] bonding_sysfs_store_option+0x4d/0x80 [bonding] [ 101.072567] kernfs_fop_write_iter+0x10c/0x1a0 [ 101.073033] vfs_write+0x2d8/0x400 [ 101.073416] ? alloc_fd+0x48/0x180 [ 101.073798] ksys_write+0x5f/0xe0 [ 101.074175] do_syscall_64+0x52/0x110 [ 101.074576] entry_SYSCALL_64_after_hwframe+0x4b/0x53 As bond_ipsec_add_sa_all and bond_ipsec_del_sa_all are only called from bond_change_active_slave, which requires holding the RTNL lock. And bond_ipsec_add_sa and bond_ipsec_del_sa are xfrm state xdo_dev_state_add and xdo_dev_state_delete APIs, which are in user context. So ipsec_lock doesn't have to be spin lock, change it to mutex, and thus the above issue can be resolved.

Where it lives

The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.

drivers/net/bonding/bond_main.c
include/net/bonding.h

What this is
BONDING DRIVERMAINTAINERS section matched on drivers/net/bonding/ · netdev@vger.kernel.org · Maintained
Kernel module
bonding

Check it on the machine

grep -w CONFIG_BONDING /boot/config-$(uname -r)

Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.

lsmod | grep -w bonding

Prints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.

Show whether Debian builds this, per release

Debian builds this as a loadable module. Every release below compiles it as a module on every flavour, so whether the code is in the running kernel depends on whether that module is loaded.

  • bookworm, trixie, forky, sidm
m
a loadable module on every flavour - check lsmod, can be blacklisted
Build switch
CONFIG_BONDING

From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages

Signals

Published
2024-09-13 (2 years ago)source
CVSS
7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it
Attack vector
local (AV:L)source
EPSS
0.17%, higher than 6.5% of all CVEssource
CISA KEV
not listedthe KEV catalogue
Debian urgency
not yet assignedsource
Subsystem
drivers/net

Upstream fixes

The versions the CNA records as introducing and fixing this, and the commit for each. source

IntroducedFixed inCommit
5.146.6.496b598069164a
5.146.10.856354b0a2c24
5.146.112aeeef906d5a
5.10.5400
5.13.600

Why the CNA scored it this way

Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source

AV:LAttack vector, local
The vulnerable paths are entered from local configuration syscalls — xfrm netlink (`XFRM_MSG_NEWSA`/`DELSA` with `XFRMA_OFFLOAD_DEV`) and rtnetlink/sysfs writes that call `bond_change_active_slave()`. No remote peer data reaches this code; the auto-failover variant only lets an on-link party influence timing, not reach the code directly.
AC:LAttack complexity, low
The atomic-sleep BUG is deterministic — a single active-slave change with offloaded SAs present reliably calls a sleeping `xdo_dev_state_add()` under `spin_lock_bh()`. For the RCU/UAF variant the attacker drives both sides of the race (one thread adding offloaded SAs, another enslaving/releasing the slave), so no uncontrolled condition is required.
PR:LPrivileges required, low
Both entry points gate only on CAP_NET_ADMIN scoped to the network namespace (`netlink_net_capable()` in xfrm_user.c, netns-scoped rtnetlink/bonding options), which an unprivileged user obtains via `unshare -Urn` or holds inside a container that has a delegated offload-capable VF. Real root in the init namespace is not required.
UI:NUser interaction, none
The attacker performs all steps themselves — adding the offloaded xfrm state and changing the bond's active slave — with no action by any other user or administrator.
S:UScope, unchanged
The fault, the corrupted scheduler/lock state, and the freed objects all live in the kernel of the same host; no VM, IOMMU, or sandbox boundary is crossed.
C:HConfidentiality impact, high
Sleeping inside the RCU read-side section defeats the `synchronize_rcu()` barrier in `__bond_release_one()`, so the sleeping caller resumes on a freed `slave`/`net_device` — a use-after-free that lets a heap-sprayed replacement object be read back through the driver's SA-programming path, exposing kernel memory.
I:HIntegrity impact, high
The same use-after-free gives a write primitive: `xs->xso.real_dev` and driver state are written through the stale `net_device`/`slave` allocation, and the fix's addition of `netdev_hold()`/`netdev_put()` confirms the object could be freed while still in use, which is exploitable for control-flow hijacking.
A:HAvailability impact, high
The confirmed, trivially reproducible effect is `BUG: scheduling while atomic` with `bond->ipsec_lock` held across a context switch, causing spinning CPUs, soft lockups/deadlock, and a panic under `panic_on_warn`; the use-after-free independently crashes the kernel.