Look up another CVE · open CVE-2024-35808 in the interactive tracker
CVE-2024-35808
md/dm-raid: don't call md_reap_sync_thread() directly
Published 2024-05-17 (2 years ago) by the Linux kernel CNA. Subsystem drivers/md. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2024-35808 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
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No 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 13trixie | fixed | 6.7.12-1 | Update the kernel and reboot. Fixed in 6.7.12-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.7.12-1 | Update the kernel and reboot. Fixed in 6.7.12-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.7.12-1 | Update the kernel and reboot. Fixed in 6.7.12-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
Currently md_reap_sync_thread() is called from raid_message() directly without holding 'reconfig_mutex', this is definitely unsafe because md_reap_sync_thread() can change many fields that is protected by 'reconfig_mutex'. However, hold 'reconfig_mutex' here is still problematic because this will cause deadlock, for example, commit 130443d60b1b ("md: refactor idle/frozen_sync_thread() to fix deadlock"). Fix this problem by using stop_sync_thread() to unregister sync_thread, like md/raid did.
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/md/dm-raid.c
- What this is
- DEVICE-MAPPER (LVM)MAINTAINERS section matched on drivers/md/dm* · dm-devel@lists.linux.dev · Maintained
- Kernel module
- dm_raid
Check it on the machine
grep -wE 'CONFIG_DM_RAID|CONFIG_MD' /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 dm_raidPrints 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 switches
- CONFIG_DM_RAID, CONFIG_MD
- Reads as
- all on means the file is compiled; any one off means it is not.
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-05-17 (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.18%, higher than 7.1% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- drivers/md
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 3.10 | 6.7.12 | 347dcdc15a17 |
| 3.10 | 6.8.3 | 9e59b8d76ff5 |
| 3.10 | 6.9 | cd32b27a66db |
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 `raid_message()` handler is reached only through the local `DM_TARGET_MSG` ioctl on /dev/mapper/control (`ctl_ioctl` → `target_message` → `ti->type->message`). No remote or adjacent network path exists.
- AC:LAttack complexity, low
- The attacker controls both sides of the race — it can start a sync/reshape with a `check`/`repair`/`resync` message and then issue concurrent `idle`/`frozen` messages from multiple threads, so two contexts enter `md_reap_sync_thread()` simultaneously; dm-raid is a standard distro module, so no rare configuration is needed.
- PR:LPrivileges required, low
- The device-mapper control ioctl is gated by CAP_SYS_ADMIN, but this is delegated capability rather than exclusive host root in practice — privileged containers, storage-management daemons and LVM helper services hold it — and kernel-CNA scoring consistently treats dm-ioctl-reachable defects as low-privilege local attacks.
- UI:NUser interaction, none
- The attacker performs every step itself (create/activate the dm-raid target, start the sync thread, issue the racing messages); no action by another user or administrator is required.
- S:UScope, unchanged
- The corruption is confined to kernel memory and on-disk RAID metadata managed by the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.
- C:HConfidentiality impact, high
- The unlocked reap yields a use-after-free/double-free of `struct md_thread` plus an unsynchronized walk of the `mddev->disks` rdev list, and reclaiming the freed slab object gives an attacker-controlled read primitive over kernel memory.
- I:HIntegrity impact, high
- The double `kfree()`/UAF is a classic heap-corruption primitive exploitable for arbitrary write and control-flow hijack, and additionally `md_update_sb()` and `pers->finish_reshape()` run concurrently with the md thread, writing inconsistent RAID superblocks and mutating array geometry mid-reshape.
- A:HAvailability impact, high
- Double-free/UAF of the sync thread reliably produces slab corruption, oops, and kernel panic, and the unsynchronized recovery-flag manipulation can wedge the sync-thread state machine into the deadlock/hang class the commit series explicitly addresses.