# CVE-2024-35979: raid1: fix use-after-free for original bio in raid1\_write\_request()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-05-20T09:42:04.424Z
- **Modified:** 2026-08-05T11:31:21.769Z

## Who should check

- Anyone running Linux \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< 3f28d49a328fe20926995d5fbdc92da665596268; \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< f423f41b7679c09abb26d2bd54be5cbef23c9446; \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< fcf3f7e2fc8a53a6140beee46ec782a4c88e4744
- Anyone running Linux 6.6

## Description

In the Linux kernel, the following vulnerability has been resolved:

raid1: fix use-after-free for original bio in raid1\_write\_request()

r1\_bio-\>bios\[\] is used to record new bios that will be issued to
underlying disks, however, in raid1\_write\_request(), r1\_bio-\>bios\[\]
will set to the original bio temporarily. Meanwhile, if blocked rdev
is set, free\_r1bio() will be called causing that all r1\_bio-\>bios\[\]
to be freed:

raid1\_write\_request()
 r1\_bio = alloc\_r1bio(mddev, bio); -\> r1\_bio-\>bios\[\] is NULL
 for (i = 0;  i \< disks; i++) -\> for each rdev in conf
  // first rdev is normal
  r1\_bio-\>bios\[0\] = bio; -\> set to original bio
  // second rdev is blocked
  if (test\_bit(Blocked, &rdev-\>flags))
   break

 if (blocked\_rdev)
  free\_r1bio()
   put\_all\_bios()
    bio\_put(r1\_bio-\>bios\[0\]) -\> original bio is freed

Test scripts:

mdadm -CR /dev/md0 -l1 -n4 /dev/sd\[abcd\] --assume-clean
fio -filename=/dev/md0 -ioengine=libaio -rw=write -bs=4k -numjobs=1 \\
    -iodepth=128 -name=test -direct=1
echo blocked \> /sys/block/md0/md/rd2/state

Test result:

BUG bio-264 (Not tainted): Object already free
-----------------------------------------------------------------------------

Allocated in mempool\_alloc\_slab+0x24/0x50 age=1 cpu=1 pid=869
 kmem\_cache\_alloc+0x324/0x480
 mempool\_alloc\_slab+0x24/0x50
 mempool\_alloc+0x6e/0x220
 bio\_alloc\_bioset+0x1af/0x4d0
 blkdev\_direct\_IO+0x164/0x8a0
 blkdev\_write\_iter+0x309/0x440
 aio\_write+0x139/0x2f0
 io\_submit\_one+0x5ca/0xb70
 \_\_do\_sys\_io\_submit+0x86/0x270
 \_\_x64\_sys\_io\_submit+0x22/0x30
 do\_syscall\_64+0xb1/0x210
 entry\_SYSCALL\_64\_after\_hwframe+0x6c/0x74
Freed in mempool\_free\_slab+0x1f/0x30 age=1 cpu=1 pid=869
 kmem\_cache\_free+0x28c/0x550
 mempool\_free\_slab+0x1f/0x30
 mempool\_free+0x40/0x100
 bio\_free+0x59/0x80
 bio\_put+0xf0/0x220
 free\_r1bio+0x74/0xb0
 raid1\_make\_request+0xadf/0x1150
 md\_handle\_request+0xc7/0x3b0
 md\_submit\_bio+0x76/0x130
 \_\_submit\_bio+0xd8/0x1d0
 submit\_bio\_noacct\_nocheck+0x1eb/0x5c0
 submit\_bio\_noacct+0x169/0xd40
 submit\_bio+0xee/0x1d0
 blkdev\_direct\_IO+0x322/0x8a0
 blkdev\_write\_iter+0x309/0x440
 aio\_write+0x139/0x2f0

Since that bios for underlying disks are not allocated yet, fix this
problem by using mempool\_free() directly to free the r1\_bio.

## Affected and fixed versions

- Linux: \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< 3f28d49a328fe20926995d5fbdc92da665596268; \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< f423f41b7679c09abb26d2bd54be5cbef23c9446; \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< fcf3f7e2fc8a53a6140beee46ec782a4c88e4744 (cvelist)
- Linux: 6.6 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-35979. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-35979.md
Affected: Linux >= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, < 3f28d49a328fe20926995d5fbdc92da665596268; >= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, < f423f41b7679c09abb26d2bd54be5cbef23c9446; >= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, < fcf3f7e2fc8a53a6140beee46ec782a4c88e4744; Linux 6.6
Fixed in: Linux 3f28d49a328fe20926995d5fbdc92da665596268

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-35979 being exploited?

There is no confirmed exploitation: CVE-2024-35979 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-35979?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-35979?

Linux \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< 3f28d49a328fe20926995d5fbdc92da665596268; \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< f423f41b7679c09abb26d2bd54be5cbef23c9446; \>= 992db13a4aee766c8bfbf046ad15c2db5fa7cab8, \< fcf3f7e2fc8a53a6140beee46ec782a4c88e4744; Linux 6.6.

### Is there a fix for CVE-2024-35979?

Yes. Fixed in Linux 3f28d49a328fe20926995d5fbdc92da665596268. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-35979?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/3f28d49a328fe20926995d5fbdc92da665596268>
- patch: <https://git.kernel.org/stable/c/f423f41b7679c09abb26d2bd54be5cbef23c9446>
- patch: <https://git.kernel.org/stable/c/fcf3f7e2fc8a53a6140beee46ec782a4c88e4744>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-35979>

HTML: <https://flawdb.com/CVE-2024-35979> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-35979>
