# CVE-2024-42311: hfs: fix to initialize fields of hfs\_inode\_info after hfs\_alloc\_inode()

> 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.34% (percentile 20, 2026-11-26)
- **CWE:** CWE-908
- **Published:** 2024-08-17T09:09:15.793Z
- **Modified:** 2026-08-05T11:36:34.141Z

## Who should check

- Anyone running Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< f7316b2b2f11cf0c6de917beee8d3de728be24db; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 4a52861cd76e79f1a593beb23d096523eb9732c2; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 10f7163bfb5f8b4e0c9c05a939f20b8540e33c65; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d55aae5c1730d6b70d5d8eaff00113cd34772ea3; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 58d83fc160505a7009c39dec64effaac5129b971; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 9c4e40b9b731220f9464975e49da75496e3865c4; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d3493d6f0dfb1ab5225b62faa77732983f2187a1; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 26a2ed107929a855155429b11e1293b83e6b2a8b
- Anyone running Linux 2.6.12

## Description

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

hfs: fix to initialize fields of hfs\_inode\_info after hfs\_alloc\_inode()

Syzbot reports uninitialized value access issue as below:

loop0: detected capacity change from 0 to 64
=====================================================
BUG: KMSAN: uninit-value in hfs\_revalidate\_dentry+0x307/0x3f0 fs/hfs/sysdep.c:30
 hfs\_revalidate\_dentry+0x307/0x3f0 fs/hfs/sysdep.c:30
 d\_revalidate fs/namei.c:862 \[inline\]
 lookup\_fast+0x89e/0x8e0 fs/namei.c:1649
 walk\_component fs/namei.c:2001 \[inline\]
 link\_path\_walk+0x817/0x1480 fs/namei.c:2332
 path\_lookupat+0xd9/0x6f0 fs/namei.c:2485
 filename\_lookup+0x22e/0x740 fs/namei.c:2515
 user\_path\_at\_empty+0x8b/0x390 fs/namei.c:2924
 user\_path\_at include/linux/namei.h:57 \[inline\]
 do\_mount fs/namespace.c:3689 \[inline\]
 \_\_do\_sys\_mount fs/namespace.c:3898 \[inline\]
 \_\_se\_sys\_mount+0x66b/0x810 fs/namespace.c:3875
 \_\_x64\_sys\_mount+0xe4/0x140 fs/namespace.c:3875
 do\_syscall\_x64 arch/x86/entry/common.c:52 \[inline\]
 do\_syscall\_64+0xcf/0x1e0 arch/x86/entry/common.c:83
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0x6b

BUG: KMSAN: uninit-value in hfs\_ext\_read\_extent fs/hfs/extent.c:196 \[inline\]
BUG: KMSAN: uninit-value in hfs\_get\_block+0x92d/0x1620 fs/hfs/extent.c:366
 hfs\_ext\_read\_extent fs/hfs/extent.c:196 \[inline\]
 hfs\_get\_block+0x92d/0x1620 fs/hfs/extent.c:366
 block\_read\_full\_folio+0x4ff/0x11b0 fs/buffer.c:2271
 hfs\_read\_folio+0x55/0x60 fs/hfs/inode.c:39
 filemap\_read\_folio+0x148/0x4f0 mm/filemap.c:2426
 do\_read\_cache\_folio+0x7c8/0xd90 mm/filemap.c:3553
 do\_read\_cache\_page mm/filemap.c:3595 \[inline\]
 read\_cache\_page+0xfb/0x2f0 mm/filemap.c:3604
 read\_mapping\_page include/linux/pagemap.h:755 \[inline\]
 hfs\_btree\_open+0x928/0x1ae0 fs/hfs/btree.c:78
 hfs\_mdb\_get+0x260c/0x3000 fs/hfs/mdb.c:204
 hfs\_fill\_super+0x1fb1/0x2790 fs/hfs/super.c:406
 mount\_bdev+0x628/0x920 fs/super.c:1359
 hfs\_mount+0xcd/0xe0 fs/hfs/super.c:456
 legacy\_get\_tree+0x167/0x2e0 fs/fs\_context.c:610
 vfs\_get\_tree+0xdc/0x5d0 fs/super.c:1489
 do\_new\_mount+0x7a9/0x16f0 fs/namespace.c:3145
 path\_mount+0xf98/0x26a0 fs/namespace.c:3475
 do\_mount fs/namespace.c:3488 \[inline\]
 \_\_do\_sys\_mount fs/namespace.c:3697 \[inline\]
 \_\_se\_sys\_mount+0x919/0x9e0 fs/namespace.c:3674
 \_\_ia32\_sys\_mount+0x15b/0x1b0 fs/namespace.c:3674
 do\_syscall\_32\_irqs\_on arch/x86/entry/common.c:112 \[inline\]
 \_\_do\_fast\_syscall\_32+0xa2/0x100 arch/x86/entry/common.c:178
 do\_fast\_syscall\_32+0x37/0x80 arch/x86/entry/common.c:203
 do\_SYSENTER\_32+0x1f/0x30 arch/x86/entry/common.c:246
 entry\_SYSENTER\_compat\_after\_hwframe+0x70/0x82

Uninit was created at:
 \_\_alloc\_pages+0x9a6/0xe00 mm/page\_alloc.c:4590
 \_\_alloc\_pages\_node include/linux/gfp.h:238 \[inline\]
 alloc\_pages\_node include/linux/gfp.h:261 \[inline\]
 alloc\_slab\_page mm/slub.c:2190 \[inline\]
 allocate\_slab mm/slub.c:2354 \[inline\]
 new\_slab+0x2d7/0x1400 mm/slub.c:2407
 \_\_\_slab\_alloc+0x16b5/0x3970 mm/slub.c:3540
 \_\_slab\_alloc mm/slub.c:3625 \[inline\]
 \_\_slab\_alloc\_node mm/slub.c:3678 \[inline\]
 slab\_alloc\_node mm/slub.c:3850 \[inline\]
 kmem\_cache\_alloc\_lru+0x64d/0xb30 mm/slub.c:3879
 alloc\_inode\_sb include/linux/fs.h:3018 \[inline\]
 hfs\_alloc\_inode+0x5a/0xc0 fs/hfs/super.c:165
 alloc\_inode+0x83/0x440 fs/inode.c:260
 new\_inode\_pseudo fs/inode.c:1005 \[inline\]
 new\_inode+0x38/0x4f0 fs/inode.c:1031
 hfs\_new\_inode+0x61/0x1010 fs/hfs/inode.c:186
 hfs\_mkdir+0x54/0x250 fs/hfs/dir.c:228
 vfs\_mkdir+0x49a/0x700 fs/namei.c:4126
 do\_mkdirat+0x529/0x810 fs/namei.c:4149
 \_\_do\_sys\_mkdirat fs/namei.c:4164 \[inline\]
 \_\_se\_sys\_mkdirat fs/namei.c:4162 \[inline\]
 \_\_x64\_sys\_mkdirat+0xc8/0x120 fs/namei.c:4162
 do\_syscall\_x64 arch/x86/entry/common.c:52 \[inline\]
 do\_syscall\_64+0xcf/0x1e0 arch/x86/entry/common.c:83
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0x6b

It missed to initialize .tz\_secondswest, .cached\_start and .cached\_blocks
fields in struct hfs\_inode\_info after hfs\_alloc\_inode(), fix it.

## Affected and fixed versions

- Linux: \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< f7316b2b2f11cf0c6de917beee8d3de728be24db; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 4a52861cd76e79f1a593beb23d096523eb9732c2; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 10f7163bfb5f8b4e0c9c05a939f20b8540e33c65; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d55aae5c1730d6b70d5d8eaff00113cd34772ea3; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 58d83fc160505a7009c39dec64effaac5129b971; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 9c4e40b9b731220f9464975e49da75496e3865c4; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d3493d6f0dfb1ab5225b62faa77732983f2187a1; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 26a2ed107929a855155429b11e1293b83e6b2a8b (cvelist)
- Linux: 2.6.12 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2024-42311.md
Affected: Linux >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < f7316b2b2f11cf0c6de917beee8d3de728be24db; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 4a52861cd76e79f1a593beb23d096523eb9732c2; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 10f7163bfb5f8b4e0c9c05a939f20b8540e33c65; >= 1da177e4c3f41524e886b7f…
Fixed in: Linux 4a52861cd76e79f1a593beb23d096523eb9732c2, Linux 10f7163bfb5f8b4e0c9c05a939f20b8540e33c65, Linux 58d83fc160505a7009c39dec64effaac5129b971, Linux 9c4e40b9b731220f9464975e49da75496e3865c4, Linux 26a2ed107929a855155429b11e1293b83e6b2a8b

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

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

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

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

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

Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< f7316b2b2f11cf0c6de917beee8d3de728be24db; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 4a52861cd76e79f1a593beb23d096523eb9732c2; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 10f7163bfb5f8b4e0c9c05a939f20b8540e33c65; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d55aae5c1730d6b70d5d8eaff00113cd34772ea3; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 58d83fc160505a7009c39dec64effaac5129b971; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 9c4e40b9b731220f9464975e49da75496e3865c4; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d3493d6f0dfb1ab5225b62faa77732983f2187a1; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 26a2ed107929a855155429b11e1293b83e6b2a8b; Linux 2.6.12.

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

Yes. Fixed in Linux 4a52861cd76e79f1a593beb23d096523eb9732c2, Linux 10f7163bfb5f8b4e0c9c05a939f20b8540e33c65, Linux 58d83fc160505a7009c39dec64effaac5129b971, Linux 9c4e40b9b731220f9464975e49da75496e3865c4, Linux 26a2ed107929a855155429b11e1293b83e6b2a8b. Upgrade Linux to 26a2ed107929a855155429b11e1293b83e6b2a8b or later.

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

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/f7316b2b2f11cf0c6de917beee8d3de728be24db>
- patch: <https://git.kernel.org/stable/c/4a52861cd76e79f1a593beb23d096523eb9732c2>
- patch: <https://git.kernel.org/stable/c/10f7163bfb5f8b4e0c9c05a939f20b8540e33c65>
- patch: <https://git.kernel.org/stable/c/d55aae5c1730d6b70d5d8eaff00113cd34772ea3>
- patch: <https://git.kernel.org/stable/c/58d83fc160505a7009c39dec64effaac5129b971>
- patch: <https://git.kernel.org/stable/c/9c4e40b9b731220f9464975e49da75496e3865c4>
- patch: <https://git.kernel.org/stable/c/d3493d6f0dfb1ab5225b62faa77732983f2187a1>
- patch: <https://git.kernel.org/stable/c/26a2ed107929a855155429b11e1293b83e6b2a8b>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- other: <https://lists.debian.org/debian-lts-announce/2024/10/msg00003.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-42311>

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