# CVE-2024-47706: block, bfq: fix possible UAF for bfqq-\>bic with merge chain

> 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.37% (percentile 23, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-10-21T11:53:40.759Z
- **Modified:** 2026-10-15T01:18:56.030Z

## Who should check

- Anyone running Linux \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< a9bdd5b36887d2bacb8bc777fd18317c99fc2587; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< bc2140534b2aae752e4f7cb4489642dbb5ec4777; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< e1277ae780cca4e69ef5468d4582dfd48f0b8320; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 8aa9de02a4be2e7006e636816ce19b0d667ceaa3; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< ddbdaad123254fb53e32480cb74a486a6868b1e0; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 7faed2896d78e48ec96229e73b30b0af6c00a9aa; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 880692ee233ba63808182705b3333403413b58f5; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 6d130db286ad0ea392c96ebb2551acf0d7308048; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 18ad4df091dd5d067d2faa8fce1180b79f7041a7
- Anyone running Linux 4.12

## Description

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

block, bfq: fix possible UAF for bfqq-\>bic with merge chain

1) initial state, three tasks:

		Process 1       Process 2	Process 3
		 (BIC1)          (BIC2)		 (BIC3)
		  \|  Λ            \|  Λ		  \|  Λ
		  \|  \|            \|  \|		  \|  \|
		  V  \|            V  \|		  V  \|
		  bfqq1           bfqq2		  bfqq3
process ref:	   1		    1		    1

2) bfqq1 merged to bfqq2:

		Process 1       Process 2	Process 3
		 (BIC1)          (BIC2)		 (BIC3)
		  \|               \|		  \|  Λ
		  \\--------------\\\|		  \|  \|
		                  V		  V  \|
		  bfqq1---------\>bfqq2		  bfqq3
process ref:	   0		    2		    1

3) bfqq2 merged to bfqq3:

		Process 1       Process 2	Process 3
		 (BIC1)          (BIC2)		 (BIC3)
	 here -\> Λ                \|		  \|
		  \\--------------\\ \\-------------\\\|
		                  V		  V
		  bfqq1---------\>bfqq2----------\>bfqq3
process ref:	   0		    1		    3

In this case, IO from Process 1 will get bfqq2 from BIC1 first, and then
get bfqq3 through merge chain, and finially handle IO by bfqq3.
Howerver, current code will think bfqq2 is owned by BIC1, like initial
state, and set bfqq2-\>bic to BIC1.

bfq\_insert\_request
-\> by Process 1
 bfqq = bfq\_init\_rq(rq)
  bfqq = bfq\_get\_bfqq\_handle\_split
   bfqq = bic\_to\_bfqq
   -\> get bfqq2 from BIC1
 bfqq-\>ref++
 rq-\>elv.priv\[0\] = bic
 rq-\>elv.priv\[1\] = bfqq
 if (bfqq\_process\_refs(bfqq) == 1)
  bfqq-\>bic = bic
  -\> record BIC1 to bfqq2

  \_\_bfq\_insert\_request
   new\_bfqq = bfq\_setup\_cooperator
   -\> get bfqq3 from bfqq2-\>new\_bfqq
   bfqq\_request\_freed(bfqq)
   new\_bfqq-\>ref++
   rq-\>elv.priv\[1\] = new\_bfqq
   -\> handle IO by bfqq3

Fix the problem by checking bfqq is from merge chain fist. And this
might fix a following problem reported by our syzkaller(unreproducible):

==================================================================
BUG: KASAN: slab-use-after-free in bfq\_do\_early\_stable\_merge block/bfq-iosched.c:5692 \[inline\]
BUG: KASAN: slab-use-after-free in bfq\_do\_or\_sched\_stable\_merge block/bfq-iosched.c:5805 \[inline\]
BUG: KASAN: slab-use-after-free in bfq\_get\_queue+0x25b0/0x2610 block/bfq-iosched.c:5889
Write of size 1 at addr ffff888123839eb8 by task kworker/0:1H/18595

CPU: 0 PID: 18595 Comm: kworker/0:1H Tainted: G             L     6.6.0-07439-gba2303cacfda \#6
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
Workqueue: kblockd blk\_mq\_requeue\_work
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
 dump\_stack\_lvl+0x91/0xf0 lib/dump\_stack.c:106
 print\_address\_description mm/kasan/report.c:364 \[inline\]
 print\_report+0x10d/0x610 mm/kasan/report.c:475
 kasan\_report+0x8e/0xc0 mm/kasan/report.c:588
 bfq\_do\_early\_stable\_merge block/bfq-iosched.c:5692 \[inline\]
 bfq\_do\_or\_sched\_stable\_merge block/bfq-iosched.c:5805 \[inline\]
 bfq\_get\_queue+0x25b0/0x2610 block/bfq-iosched.c:5889
 bfq\_get\_bfqq\_handle\_split+0x169/0x5d0 block/bfq-iosched.c:6757
 bfq\_init\_rq block/bfq-iosched.c:6876 \[inline\]
 bfq\_insert\_request block/bfq-iosched.c:6254 \[inline\]
 bfq\_insert\_requests+0x1112/0x5cf0 block/bfq-iosched.c:6304
 blk\_mq\_insert\_request+0x290/0x8d0 block/blk-mq.c:2593
 blk\_mq\_requeue\_work+0x6bc/0xa70 block/blk-mq.c:1502
 process\_one\_work kernel/workqueue.c:2627 \[inline\]
 process\_scheduled\_works+0x432/0x13f0 kernel/workqueue.c:2700
 worker\_thread+0x6f2/0x1160 kernel/workqueue.c:2781
 kthread+0x33c/0x440 kernel/kthread.c:388
 ret\_from\_fork+0x4d/0x80 arch/x86/kernel/process.c:147
 ret\_from\_fork\_asm+0x1b/0x30 arch/x86/entry/entry\_64.S:305
 \</TASK\>

Allocated by task 20776:
 kasan\_save\_stack+0x20/0x40 mm/kasan/common.c:45
 kasan\_set\_track+0x25/0x30 mm/kasan/common.c:52
 \_\_kasan\_slab\_alloc+0x87/0x90 mm/kasan/common.c:328
 kasan\_slab\_alloc include/linux/kasan.h:188 \[inline\]
 slab\_post\_alloc\_hook mm/slab.h:763 \[inline\]
 slab\_alloc\_node mm/slub.c:3458 \[inline\]
 kmem\_cache\_alloc\_node+0x1a4/0x6f0 mm/slub.c:3503
 ioc\_create\_icq block/blk-ioc.c:370 \[inline\]
---truncated---

## Affected and fixed versions

- Linux: \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< a9bdd5b36887d2bacb8bc777fd18317c99fc2587; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< bc2140534b2aae752e4f7cb4489642dbb5ec4777; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< e1277ae780cca4e69ef5468d4582dfd48f0b8320; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 8aa9de02a4be2e7006e636816ce19b0d667ceaa3; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< ddbdaad123254fb53e32480cb74a486a6868b1e0; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 7faed2896d78e48ec96229e73b30b0af6c00a9aa; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 880692ee233ba63808182705b3333403413b58f5; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 6d130db286ad0ea392c96ebb2551acf0d7308048; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 18ad4df091dd5d067d2faa8fce1180b79f7041a7 (cvelist)
- Linux: 4.12 (cvelist)

## Mitigation

- Upgrade Linux to 18ad4df091dd5d067d2faa8fce1180b79f7041a7 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-47706.md
Affected: Linux >= 36eca894832351feed9072d0f97eb06fc9482ca4, < a9bdd5b36887d2bacb8bc777fd18317c99fc2587; >= 36eca894832351feed9072d0f97eb06fc9482ca4, < bc2140534b2aae752e4f7cb4489642dbb5ec4777; >= 36eca894832351feed9072d0f97eb06fc9482ca4, < e1277ae780cca4e69ef5468d4582dfd48f0b8320; >= 36eca894832351feed9072d…
Fixed in: Linux 8aa9de02a4be2e7006e636816ce19b0d667ceaa3, Linux 7faed2896d78e48ec96229e73b30b0af6c00a9aa, Linux 880692ee233ba63808182705b3333403413b58f5, Linux 6d130db286ad0ea392c96ebb2551acf0d7308048, Linux 18ad4df091dd5d067d2faa8fce1180b79f7041a7

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-47706 being exploited?

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

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

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

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

Linux \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< a9bdd5b36887d2bacb8bc777fd18317c99fc2587; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< bc2140534b2aae752e4f7cb4489642dbb5ec4777; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< e1277ae780cca4e69ef5468d4582dfd48f0b8320; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 8aa9de02a4be2e7006e636816ce19b0d667ceaa3; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< ddbdaad123254fb53e32480cb74a486a6868b1e0; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 7faed2896d78e48ec96229e73b30b0af6c00a9aa; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 880692ee233ba63808182705b3333403413b58f5; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 6d130db286ad0ea392c96ebb2551acf0d7308048; \>= 36eca894832351feed9072d0f97eb06fc9482ca4, \< 18ad4df091dd5d067d2faa8fce1180b79f7041a7; Linux 4.12.

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

Yes. Fixed in Linux 8aa9de02a4be2e7006e636816ce19b0d667ceaa3, Linux 7faed2896d78e48ec96229e73b30b0af6c00a9aa, Linux 880692ee233ba63808182705b3333403413b58f5, Linux 6d130db286ad0ea392c96ebb2551acf0d7308048, Linux 18ad4df091dd5d067d2faa8fce1180b79f7041a7. Upgrade Linux to 18ad4df091dd5d067d2faa8fce1180b79f7041a7 or later.

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

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/e1277ae780cca4e69ef5468d4582dfd48f0b8320>
- patch: <https://git.kernel.org/stable/c/8aa9de02a4be2e7006e636816ce19b0d667ceaa3>
- patch: <https://git.kernel.org/stable/c/ddbdaad123254fb53e32480cb74a486a6868b1e0>
- patch: <https://git.kernel.org/stable/c/7faed2896d78e48ec96229e73b30b0af6c00a9aa>
- patch: <https://git.kernel.org/stable/c/880692ee233ba63808182705b3333403413b58f5>
- patch: <https://git.kernel.org/stable/c/6d130db286ad0ea392c96ebb2551acf0d7308048>
- patch: <https://git.kernel.org/stable/c/18ad4df091dd5d067d2faa8fce1180b79f7041a7>
- other: <https://git.kernel.org/stable/c/a9bdd5b36887d2bacb8bc777fd18317c99fc2587>
- other: <https://git.kernel.org/stable/c/bc2140534b2aae752e4f7cb4489642dbb5ec4777>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-355557.html>

## 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-47706>

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