# CVE-2025-40082: hfsplus: fix slab-out-of-bounds read in hfsplus\_uni2asc()

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

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; 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.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-10-28T11:48:45.975Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= ccf0ad56a779e6704c0b27f555dec847f50c7557, \< 343fe375a8dd6ee51a193a1c233b999f5ea4d479; \>= 13604b1d7e7b125fb428cddbec6b8d92baad25d5, \< 782acde47e127c98a113726e2ff8024bd65c0454; \>= 291bb5d931c6f3cd7227b913302a17be21cf53b0, \< c3db89ea1ed3d540eebe8f3c36e806fb75ee4a1e; \>= f7534cbfac0a9ffa4fa17cacc6e8b6446dae24ee, \< 5b5228964619b180f366940505b77255b1a03929; \>= 94458781aee6045bd3d0ad4b80b02886b9e2219b, \< 857aefc70d4ae3b9bf1ae67434d27d0f79f80c9e; \>= 94458781aee6045bd3d0ad4b80b02886b9e2219b, \< bea3e1d4467bcf292c8e54f080353d556d355e26; 73f7da507d787b489761a0fa280716f84fa32b2f; 76a4c6636a69d69409aa253b049b1be717a539c5; 6f93694bcbc2c2ab3e01cd8fba2f296faf34e6b9; 1ca69007e52a73bd8b84b988b61b319816ca8b01; …
- Anyone running Linux 6.17

## Description

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

hfsplus: fix slab-out-of-bounds read in hfsplus\_uni2asc()

BUG: KASAN: slab-out-of-bounds in hfsplus\_uni2asc+0xa71/0xb90 fs/hfsplus/unicode.c:186
Read of size 2 at addr ffff8880289ef218 by task syz.6.248/14290

CPU: 0 UID: 0 PID: 14290 Comm: syz.6.248 Not tainted 6.16.4 \#1 PREEMPT(full)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:94 \[inline\]
 dump\_stack\_lvl+0x116/0x1b0 lib/dump\_stack.c:120
 print\_address\_description mm/kasan/report.c:378 \[inline\]
 print\_report+0xca/0x5f0 mm/kasan/report.c:482
 kasan\_report+0xca/0x100 mm/kasan/report.c:595
 hfsplus\_uni2asc+0xa71/0xb90 fs/hfsplus/unicode.c:186
 hfsplus\_listxattr+0x5b6/0xbd0 fs/hfsplus/xattr.c:738
 vfs\_listxattr+0xbe/0x140 fs/xattr.c:493
 listxattr+0xee/0x190 fs/xattr.c:924
 filename\_listxattr fs/xattr.c:958 \[inline\]
 path\_listxattrat+0x143/0x360 fs/xattr.c:988
 do\_syscall\_x64 arch/x86/entry/syscall\_64.c:63 \[inline\]
 do\_syscall\_64+0xcb/0x4c0 arch/x86/entry/syscall\_64.c:94
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
RIP: 0033:0x7fe0e9fae16d
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe0eae67f98 EFLAGS: 00000246 ORIG\_RAX: 00000000000000c3
RAX: ffffffffffffffda RBX: 00007fe0ea205fa0 RCX: 00007fe0e9fae16d
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000000
RBP: 00007fe0ea0480f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe0ea206038 R14: 00007fe0ea205fa0 R15: 00007fe0eae48000
 \</TASK\>

Allocated by task 14290:
 kasan\_save\_stack+0x24/0x50 mm/kasan/common.c:47
 kasan\_save\_track+0x14/0x30 mm/kasan/common.c:68
 poison\_kmalloc\_redzone mm/kasan/common.c:377 \[inline\]
 \_\_kasan\_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
 kasan\_kmalloc include/linux/kasan.h:260 \[inline\]
 \_\_do\_kmalloc\_node mm/slub.c:4333 \[inline\]
 \_\_kmalloc\_noprof+0x219/0x540 mm/slub.c:4345
 kmalloc\_noprof include/linux/slab.h:909 \[inline\]
 hfsplus\_find\_init+0x95/0x1f0 fs/hfsplus/bfind.c:21
 hfsplus\_listxattr+0x331/0xbd0 fs/hfsplus/xattr.c:697
 vfs\_listxattr+0xbe/0x140 fs/xattr.c:493
 listxattr+0xee/0x190 fs/xattr.c:924
 filename\_listxattr fs/xattr.c:958 \[inline\]
 path\_listxattrat+0x143/0x360 fs/xattr.c:988
 do\_syscall\_x64 arch/x86/entry/syscall\_64.c:63 \[inline\]
 do\_syscall\_64+0xcb/0x4c0 arch/x86/entry/syscall\_64.c:94
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f

When hfsplus\_uni2asc is called from hfsplus\_listxattr,
it actually passes in a struct hfsplus\_attr\_unistr\*.
The size of the corresponding structure is different from that of hfsplus\_unistr,
so the previous fix (94458781aee6) is insufficient.
The pointer on the unicode buffer is still going beyond the allocated memory.

This patch introduces two warpper functions hfsplus\_uni2asc\_xattr\_str and
hfsplus\_uni2asc\_str to process two unicode buffers,
struct hfsplus\_attr\_unistr\* and struct hfsplus\_unistr\* respectively.
When ustrlen value is bigger than the allocated memory size,
the ustrlen value is limited to an safe size.

## Affected and fixed versions

- Linux: \>= ccf0ad56a779e6704c0b27f555dec847f50c7557, \< 343fe375a8dd6ee51a193a1c233b999f5ea4d479; \>= 13604b1d7e7b125fb428cddbec6b8d92baad25d5, \< 782acde47e127c98a113726e2ff8024bd65c0454; \>= 291bb5d931c6f3cd7227b913302a17be21cf53b0, \< c3db89ea1ed3d540eebe8f3c36e806fb75ee4a1e; \>= f7534cbfac0a9ffa4fa17cacc6e8b6446dae24ee, \< 5b5228964619b180f366940505b77255b1a03929; \>= 94458781aee6045bd3d0ad4b80b02886b9e2219b, \< 857aefc70d4ae3b9bf1ae67434d27d0f79f80c9e; \>= 94458781aee6045bd3d0ad4b80b02886b9e2219b, \< bea3e1d4467bcf292c8e54f080353d556d355e26; 73f7da507d787b489761a0fa280716f84fa32b2f; 76a4c6636a69d69409aa253b049b1be717a539c5; 6f93694bcbc2c2ab3e01cd8fba2f296faf34e6b9; 1ca69007e52a73bd8b84b988b61b319816ca8b01; … (cvelist)
- Linux: 6.17 (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-2025-40082. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40082.md
Affected: Linux >= ccf0ad56a779e6704c0b27f555dec847f50c7557, < 343fe375a8dd6ee51a193a1c233b999f5ea4d479; >= 13604b1d7e7b125fb428cddbec6b8d92baad25d5, < 782acde47e127c98a113726e2ff8024bd65c0454; >= 291bb5d931c6f3cd7227b913302a17be21cf53b0, < c3db89ea1ed3d540eebe8f3c36e806fb75ee4a1e; >= f7534cbfac0a9ffa4fa17ca…
Fixed in: Linux 343fe375a8dd6ee51a193a1c233b999f5ea4d479, Linux 782acde47e127c98a113726e2ff8024bd65c0454, Linux 5b5228964619b180f366940505b77255b1a03929, Linux 857aefc70d4ae3b9bf1ae67434d27d0f79f80c9e

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-2025-40082 being exploited?

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

### How serious is CVE-2025-40082?

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

### Which versions are affected by CVE-2025-40082?

Linux \>= ccf0ad56a779e6704c0b27f555dec847f50c7557, \< 343fe375a8dd6ee51a193a1c233b999f5ea4d479; \>= 13604b1d7e7b125fb428cddbec6b8d92baad25d5, \< 782acde47e127c98a113726e2ff8024bd65c0454; \>= 291bb5d931c6f3cd7227b913302a17be21cf53b0, \< c3db89ea1ed3d540eebe8f3c36e806fb75ee4a1e; \>= f7534cbfac0a9ffa4fa17cacc6e8b6446dae24ee, \< 5b5228964619b180f366940505b77255b1a03929; \>= 94458781aee6045bd3d0ad4b80b02886b9e2219b, \< 857aefc70d4ae3b9bf1ae67434d27d0f79f80c9e; \>= 94458781aee6045bd3d0ad4b80b02886b9e2219b, \< bea3e1d4467bcf292c8e54f080353d556d355e26; 73f7da507d787b489761a0fa280716f84fa32b2f; 76a4c6636a69d69409aa253b049b1be717a539c5; 6f93694bcbc2c2ab3e01cd8fba2f296faf34e6b9; 1ca69007e52a73bd8b84b988b61b319816ca8b01; …; Linux 6.17.

### Is there a fix for CVE-2025-40082?

Yes. Fixed in Linux 343fe375a8dd6ee51a193a1c233b999f5ea4d479, Linux 782acde47e127c98a113726e2ff8024bd65c0454, Linux 5b5228964619b180f366940505b77255b1a03929, Linux 857aefc70d4ae3b9bf1ae67434d27d0f79f80c9e. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-40082?

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/343fe375a8dd6ee51a193a1c233b999f5ea4d479>
- patch: <https://git.kernel.org/stable/c/782acde47e127c98a113726e2ff8024bd65c0454>
- patch: <https://git.kernel.org/stable/c/c3db89ea1ed3d540eebe8f3c36e806fb75ee4a1e>
- patch: <https://git.kernel.org/stable/c/5b5228964619b180f366940505b77255b1a03929>
- patch: <https://git.kernel.org/stable/c/857aefc70d4ae3b9bf1ae67434d27d0f79f80c9e>
- patch: <https://git.kernel.org/stable/c/bea3e1d4467bcf292c8e54f080353d556d355e26>

## 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-2025-40082>

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