# CVE-2024-56772: kunit: string-stream: Fix a UAF bug in kunit\_init\_suite()

> 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.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-01-08T17:49:11.544Z
- **Modified:** 2026-06-17T08:12:57.340Z

## Who should check

- Anyone running Linux \>= a3fdf784780ccb0008d630e8722d1389c49c7499, \< 3213b92754b94dec6836e8b4d6ec7d224a805b61; \>= a3fdf784780ccb0008d630e8722d1389c49c7499, \< 39e21403c978862846fa68b7f6d06f9cca235194
- Anyone running Linux 6.7

## Description

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

kunit: string-stream: Fix a UAF bug in kunit\_init\_suite()

In kunit\_debugfs\_create\_suite(), if alloc\_string\_stream() fails in the
kunit\_suite\_for\_each\_test\_case() loop, the "suite-\>log = stream"
has assigned before, and the error path only free the suite-\>log's stream
memory but not set it to NULL, so the later string\_stream\_clear() of
suite-\>log in kunit\_init\_suite() will cause below UAF bug.

Set stream pointer to NULL after free to fix it.

	Unable to handle kernel paging request at virtual address 006440150000030d
	Mem abort info:
	  ESR = 0x0000000096000004
	  EC = 0x25: DABT (current EL), IL = 32 bits
	  SET = 0, FnV = 0
	  EA = 0, S1PTW = 0
	  FSC = 0x04: level 0 translation fault
	Data abort info:
	  ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
	  CM = 0, WnR = 0, TnD = 0, TagAccess = 0
	  GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
	\[006440150000030d\] address between user and kernel address ranges
	Internal error: Oops: 0000000096000004 \[\#1\] PREEMPT SMP
	Dumping ftrace buffer:
	   (ftrace buffer empty)
	Modules linked in: iio\_test\_gts industrialio\_gts\_helper cfg80211 rfkill ipv6 \[last unloaded: iio\_test\_gts\]
	CPU: 5 UID: 0 PID: 6253 Comm: modprobe Tainted: G    B   W        N 6.12.0-rc4+ \#458
	Tainted: \[B\]=BAD\_PAGE, \[W\]=WARN, \[N\]=TEST
	Hardware name: linux,dummy-virt (DT)
	pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
	pc : string\_stream\_clear+0x54/0x1ac
	lr : string\_stream\_clear+0x1a8/0x1ac
	sp : ffffffc080b47410
	x29: ffffffc080b47410 x28: 006440550000030d x27: ffffff80c96b5e98
	x26: ffffff80c96b5e80 x25: ffffffe461b3f6c0 x24: 0000000000000003
	x23: ffffff80c96b5e88 x22: 1ffffff019cdf4fc x21: dfffffc000000000
	x20: ffffff80ce6fa7e0 x19: 032202a80000186d x18: 0000000000001840
	x17: 0000000000000000 x16: 0000000000000000 x15: ffffffe45c355cb4
	x14: ffffffe45c35589c x13: ffffffe45c03da78 x12: ffffffb810168e75
	x11: 1ffffff810168e74 x10: ffffffb810168e74 x9 : dfffffc000000000
	x8 : 0000000000000004 x7 : 0000000000000003 x6 : 0000000000000001
	x5 : ffffffc080b473a0 x4 : 0000000000000000 x3 : 0000000000000000
	x2 : 0000000000000001 x1 : ffffffe462fbf620 x0 : dfffffc000000000
	Call trace:
	 string\_stream\_clear+0x54/0x1ac
	 \_\_kunit\_test\_suites\_init+0x108/0x1d8
	 kunit\_exec\_run\_tests+0xb8/0x100
	 kunit\_module\_notify+0x400/0x55c
	 notifier\_call\_chain+0xfc/0x3b4
	 blocking\_notifier\_call\_chain+0x68/0x9c
	 do\_init\_module+0x24c/0x5c8
	 load\_module+0x4acc/0x4e90
	 init\_module\_from\_file+0xd4/0x128
	 idempotent\_init\_module+0x2d4/0x57c
	 \_\_arm64\_sys\_finit\_module+0xac/0x100
	 invoke\_syscall+0x6c/0x258
	 el0\_svc\_common.constprop.0+0x160/0x22c
	 do\_el0\_svc+0x44/0x5c
	 el0\_svc+0x48/0xb8
	 el0t\_64\_sync\_handler+0x13c/0x158
	 el0t\_64\_sync+0x190/0x194
	Code: f9400753 d2dff800 f2fbffe0 d343fe7c (38e06b80)
	---\[ end trace 0000000000000000 \]---
	Kernel panic - not syncing: Oops: Fatal exception

## Affected and fixed versions

- Linux: \>= a3fdf784780ccb0008d630e8722d1389c49c7499, \< 3213b92754b94dec6836e8b4d6ec7d224a805b61; \>= a3fdf784780ccb0008d630e8722d1389c49c7499, \< 39e21403c978862846fa68b7f6d06f9cca235194 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

- Upgrade Linux to 39e21403c978862846fa68b7f6d06f9cca235194 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-56772. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-56772.md
Affected: Linux >= a3fdf784780ccb0008d630e8722d1389c49c7499, < 3213b92754b94dec6836e8b4d6ec7d224a805b61; >= a3fdf784780ccb0008d630e8722d1389c49c7499, < 39e21403c978862846fa68b7f6d06f9cca235194; Linux 6.7
Fixed in: Linux 3213b92754b94dec6836e8b4d6ec7d224a805b61, Linux 39e21403c978862846fa68b7f6d06f9cca235194

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

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

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

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

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

Linux \>= a3fdf784780ccb0008d630e8722d1389c49c7499, \< 3213b92754b94dec6836e8b4d6ec7d224a805b61; \>= a3fdf784780ccb0008d630e8722d1389c49c7499, \< 39e21403c978862846fa68b7f6d06f9cca235194; Linux 6.7.

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

Yes. Fixed in Linux 3213b92754b94dec6836e8b4d6ec7d224a805b61, Linux 39e21403c978862846fa68b7f6d06f9cca235194. Upgrade Linux to 39e21403c978862846fa68b7f6d06f9cca235194 or later.

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

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/3213b92754b94dec6836e8b4d6ec7d224a805b61>
- patch: <https://git.kernel.org/stable/c/39e21403c978862846fa68b7f6d06f9cca235194>

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

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