# CVE-2024-40952: ocfs2: fix NULL pointer dereference in ocfs2\_journal\_dirty()

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-07-12T12:31:56.160Z
- **Modified:** 2026-06-17T07:46:56.493Z

## Who should check

- Anyone running Linux \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 0550ad87711f815b3d73e487ec58ca7d8f56edbc; \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 72663d3e09091f431a0774227ca207c0358362dd; \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 58f7e1e2c9e72c7974054c64c3abeac81c11f822
- Anyone running Linux 6.6

## Description

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

ocfs2: fix NULL pointer dereference in ocfs2\_journal\_dirty()

bdev-\>bd\_super has been removed and commit 8887b94d9322 change the usage
from bdev-\>bd\_super to b\_assoc\_map-\>host-\>i\_sb.  This introduces the
following NULL pointer dereference in ocfs2\_journal\_dirty() since
b\_assoc\_map is still not initialized.  This can be easily reproduced by
running xfstests generic/186, which simulate no more credits.

\[  134.351592\] BUG: kernel NULL pointer dereference, address: 0000000000000000
...
\[  134.355341\] RIP: 0010:ocfs2\_journal\_dirty+0x14f/0x160 \[ocfs2\]
...
\[  134.365071\] Call Trace:
\[  134.365312\]  \<TASK\>
\[  134.365524\]  ? \_\_die\_body+0x1e/0x60
\[  134.365868\]  ? page\_fault\_oops+0x13d/0x4f0
\[  134.366265\]  ? \_\_pfx\_bit\_wait\_io+0x10/0x10
\[  134.366659\]  ? schedule+0x27/0xb0
\[  134.366981\]  ? exc\_page\_fault+0x6a/0x140
\[  134.367356\]  ? asm\_exc\_page\_fault+0x26/0x30
\[  134.367762\]  ? ocfs2\_journal\_dirty+0x14f/0x160 \[ocfs2\]
\[  134.368305\]  ? ocfs2\_journal\_dirty+0x13d/0x160 \[ocfs2\]
\[  134.368837\]  ocfs2\_create\_new\_meta\_bhs.isra.51+0x139/0x2e0 \[ocfs2\]
\[  134.369454\]  ocfs2\_grow\_tree+0x688/0x8a0 \[ocfs2\]
\[  134.369927\]  ocfs2\_split\_and\_insert.isra.67+0x35c/0x4a0 \[ocfs2\]
\[  134.370521\]  ocfs2\_split\_extent+0x314/0x4d0 \[ocfs2\]
\[  134.371019\]  ocfs2\_change\_extent\_flag+0x174/0x410 \[ocfs2\]
\[  134.371566\]  ocfs2\_add\_refcount\_flag+0x3fa/0x630 \[ocfs2\]
\[  134.372117\]  ocfs2\_reflink\_remap\_extent+0x21b/0x4c0 \[ocfs2\]
\[  134.372994\]  ? inode\_update\_timestamps+0x4a/0x120
\[  134.373692\]  ? \_\_pfx\_ocfs2\_journal\_access\_di+0x10/0x10 \[ocfs2\]
\[  134.374545\]  ? \_\_pfx\_ocfs2\_journal\_access\_di+0x10/0x10 \[ocfs2\]
\[  134.375393\]  ocfs2\_reflink\_remap\_blocks+0xe4/0x4e0 \[ocfs2\]
\[  134.376197\]  ocfs2\_remap\_file\_range+0x1de/0x390 \[ocfs2\]
\[  134.376971\]  ? security\_file\_permission+0x29/0x50
\[  134.377644\]  vfs\_clone\_file\_range+0xfe/0x320
\[  134.378268\]  ioctl\_file\_clone+0x45/0xa0
\[  134.378853\]  do\_vfs\_ioctl+0x457/0x990
\[  134.379422\]  \_\_x64\_sys\_ioctl+0x6e/0xd0
\[  134.379987\]  do\_syscall\_64+0x5d/0x170
\[  134.380550\]  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
\[  134.381231\] RIP: 0033:0x7fa4926397cb
\[  134.381786\] Code: 73 01 c3 48 8b 0d bd 56 38 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 10 00 00 00 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8d 56 38 00 f7 d8 64 89 01 48
\[  134.383930\] RSP: 002b:00007ffc2b39f7b8 EFLAGS: 00000246 ORIG\_RAX: 0000000000000010
\[  134.384854\] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fa4926397cb
\[  134.385734\] RDX: 00007ffc2b39f7f0 RSI: 000000004020940d RDI: 0000000000000003
\[  134.386606\] RBP: 0000000000000000 R08: 00111a82a4f015bb R09: 00007fa494221000
\[  134.387476\] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
\[  134.388342\] R13: 0000000000f10000 R14: 0000558e844e2ac8 R15: 0000000000f10000
\[  134.389207\]  \</TASK\>

Fix it by only aborting transaction and journal in ocfs2\_journal\_dirty()
now, and leave ocfs2\_abort() later when detecting an aborted handle,
e.g. start next transaction. Also log the handle details in this case.

## Affected and fixed versions

- Linux: \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 0550ad87711f815b3d73e487ec58ca7d8f56edbc; \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 72663d3e09091f431a0774227ca207c0358362dd; \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 58f7e1e2c9e72c7974054c64c3abeac81c11f822 (cvelist)
- Linux: 6.6 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2024-40952.md
Affected: Linux >= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, < 0550ad87711f815b3d73e487ec58ca7d8f56edbc; >= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, < 72663d3e09091f431a0774227ca207c0358362dd; >= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, < 58f7e1e2c9e72c7974054c64c3abeac81c11f822; Linux 6.6
Fixed in: Linux 0550ad87711f815b3d73e487ec58ca7d8f56edbc, Linux 72663d3e09091f431a0774227ca207c0358362dd, Linux 58f7e1e2c9e72c7974054c64c3abeac81c11f822

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

There is no confirmed exploitation: CVE-2024-40952 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-40952?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 0550ad87711f815b3d73e487ec58ca7d8f56edbc; \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 72663d3e09091f431a0774227ca207c0358362dd; \>= 8887b94d93224e0ef7e1bc6369640e313b8b12f4, \< 58f7e1e2c9e72c7974054c64c3abeac81c11f822; Linux 6.6.

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

Yes. Fixed in Linux 0550ad87711f815b3d73e487ec58ca7d8f56edbc, Linux 72663d3e09091f431a0774227ca207c0358362dd, Linux 58f7e1e2c9e72c7974054c64c3abeac81c11f822. Upgrade Linux to 58f7e1e2c9e72c7974054c64c3abeac81c11f822 or later.

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

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/0550ad87711f815b3d73e487ec58ca7d8f56edbc>
- patch: <https://git.kernel.org/stable/c/72663d3e09091f431a0774227ca207c0358362dd>
- patch: <https://git.kernel.org/stable/c/58f7e1e2c9e72c7974054c64c3abeac81c11f822>

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

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