# CVE-2022-50581: hfs: fix OOB Read in \_\_hfs\_brec\_find

> 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.25% (percentile 10, 2026-11-26)
- **Published:** 2025-10-22T13:23:33.421Z
- **Modified:** 2026-08-05T08:59:11.666Z

## Who should check

- Anyone running Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 8c40f2dbae603ef0bd21e87c63f54ec59fd88256; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< c886c10a6eddb99923b315f42bf63f448883ef9a; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 90103ccb6e60aa4efe48993d23d6a528472f2233; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 4fd3a11804c8877ff11fec59c5c53f1635331e3e; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 367296925c7625c3969d2a78d7a3e1dee161beb5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< e9e692917c6e10a7066c7a6d092dcdc3d4e329f3; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< bfc9d8f27f89717431a6aecce42ae230b437433f; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 8d824e69d9f3fa3121b2dda25053bae71e2460d2
- Anyone running Linux 2.6.12

## Description

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

hfs: fix OOB Read in \_\_hfs\_brec\_find

Syzbot reported a OOB read bug:

==================================================================
BUG: KASAN: slab-out-of-bounds in hfs\_strcmp+0x117/0x190
fs/hfs/string.c:84
Read of size 1 at addr ffff88807eb62c4e by task kworker/u4:1/11
CPU: 1 PID: 11 Comm: kworker/u4:1 Not tainted
6.1.0-rc6-syzkaller-00308-g644e9524388a \#0
Workqueue: writeback wb\_workfn (flush-7:0)
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
 dump\_stack\_lvl+0x1b1/0x28e lib/dump\_stack.c:106
 print\_address\_description+0x74/0x340 mm/kasan/report.c:284
 print\_report+0x107/0x1f0 mm/kasan/report.c:395
 kasan\_report+0xcd/0x100 mm/kasan/report.c:495
 hfs\_strcmp+0x117/0x190 fs/hfs/string.c:84
 \_\_hfs\_brec\_find+0x213/0x5c0 fs/hfs/bfind.c:75
 hfs\_brec\_find+0x276/0x520 fs/hfs/bfind.c:138
 hfs\_write\_inode+0x34c/0xb40 fs/hfs/inode.c:462
 write\_inode fs/fs-writeback.c:1440 \[inline\]

If the input inode of hfs\_write\_inode() is incorrect:
struct inode
  struct hfs\_inode\_info
    struct hfs\_cat\_key
      struct hfs\_name
        u8 len \# len is greater than HFS\_NAMELEN(31) which is the
maximum length of an HFS filename

OOB read occurred:
hfs\_write\_inode()
  hfs\_brec\_find()
    \_\_hfs\_brec\_find()
      hfs\_cat\_keycmp()
        hfs\_strcmp() \# OOB read occurred due to len is too large

Fix this by adding a Check on len in hfs\_write\_inode() before calling
hfs\_brec\_find().

## Affected and fixed versions

- Linux: \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 8c40f2dbae603ef0bd21e87c63f54ec59fd88256; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< c886c10a6eddb99923b315f42bf63f448883ef9a; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 90103ccb6e60aa4efe48993d23d6a528472f2233; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 4fd3a11804c8877ff11fec59c5c53f1635331e3e; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 367296925c7625c3969d2a78d7a3e1dee161beb5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< e9e692917c6e10a7066c7a6d092dcdc3d4e329f3; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< bfc9d8f27f89717431a6aecce42ae230b437433f; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 8d824e69d9f3fa3121b2dda25053bae71e2460d2 (cvelist)
- Linux: 2.6.12 (cvelist)

## Mitigation

- Upgrade Linux to 8d824e69d9f3fa3121b2dda25053bae71e2460d2 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-50581.md
Affected: Linux >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 8c40f2dbae603ef0bd21e87c63f54ec59fd88256; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < c886c10a6eddb99923b315f42bf63f448883ef9a; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30; >= 1da177e4c3f41524e886b7f…
Fixed in: Linux 8c40f2dbae603ef0bd21e87c63f54ec59fd88256, Linux 2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30, Linux 90103ccb6e60aa4efe48993d23d6a528472f2233, Linux 4fd3a11804c8877ff11fec59c5c53f1635331e3e, Linux 367296925c7625c3969d2a78d7a3e1dee161beb5, Linux 8d824e69d9f3fa3121b2dda25053bae71e2460d2

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-2022-50581 being exploited?

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

### How serious is CVE-2022-50581?

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

### Which versions are affected by CVE-2022-50581?

Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 8c40f2dbae603ef0bd21e87c63f54ec59fd88256; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< c886c10a6eddb99923b315f42bf63f448883ef9a; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 90103ccb6e60aa4efe48993d23d6a528472f2233; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 4fd3a11804c8877ff11fec59c5c53f1635331e3e; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 367296925c7625c3969d2a78d7a3e1dee161beb5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< e9e692917c6e10a7066c7a6d092dcdc3d4e329f3; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< bfc9d8f27f89717431a6aecce42ae230b437433f; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 8d824e69d9f3fa3121b2dda25053bae71e2460d2; Linux 2.6.12.

### Is there a fix for CVE-2022-50581?

Yes. Fixed in Linux 8c40f2dbae603ef0bd21e87c63f54ec59fd88256, Linux 2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30, Linux 90103ccb6e60aa4efe48993d23d6a528472f2233, Linux 4fd3a11804c8877ff11fec59c5c53f1635331e3e, Linux 367296925c7625c3969d2a78d7a3e1dee161beb5, Linux 8d824e69d9f3fa3121b2dda25053bae71e2460d2. Upgrade Linux to 8d824e69d9f3fa3121b2dda25053bae71e2460d2 or later.

### How do I check if I'm affected by CVE-2022-50581?

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

- other: <https://git.kernel.org/stable/c/8c40f2dbae603ef0bd21e87c63f54ec59fd88256>
- other: <https://git.kernel.org/stable/c/c886c10a6eddb99923b315f42bf63f448883ef9a>
- other: <https://git.kernel.org/stable/c/2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30>
- other: <https://git.kernel.org/stable/c/90103ccb6e60aa4efe48993d23d6a528472f2233>
- other: <https://git.kernel.org/stable/c/4fd3a11804c8877ff11fec59c5c53f1635331e3e>
- other: <https://git.kernel.org/stable/c/367296925c7625c3969d2a78d7a3e1dee161beb5>
- other: <https://git.kernel.org/stable/c/e9e692917c6e10a7066c7a6d092dcdc3d4e329f3>
- other: <https://git.kernel.org/stable/c/bfc9d8f27f89717431a6aecce42ae230b437433f>
- other: <https://git.kernel.org/stable/c/8d824e69d9f3fa3121b2dda25053bae71e2460d2>

## 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-2022-50581>

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