CVE-2022-50581

Source
https://cve.org/CVERecord?id=CVE-2022-50581
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50581.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-50581
Downstream
Related
Published
2025-10-22T13:23:33.421Z
Modified
2026-03-20T11:47:32.043583Z
Summary
hfs: fix OOB Read in __hfs_brec_find
Details

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

hfs: fix OOB Read in __hfsbrecfind

Syzbot reported a OOB read bug:

================================================================== BUG: KASAN: slab-out-of-bounds in hfsstrcmp+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 wbworkfn (flush-7:0) Call Trace: <TASK> __dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0x1b1/0x28e lib/dumpstack.c:106 printaddressdescription+0x74/0x340 mm/kasan/report.c:284 printreport+0x107/0x1f0 mm/kasan/report.c:395 kasanreport+0xcd/0x100 mm/kasan/report.c:495 hfsstrcmp+0x117/0x190 fs/hfs/string.c:84 _hfsbrecfind+0x213/0x5c0 fs/hfs/bfind.c:75 hfsbrecfind+0x276/0x520 fs/hfs/bfind.c:138 hfswriteinode+0x34c/0xb40 fs/hfs/inode.c:462 writeinode fs/fs-writeback.c:1440 [inline]

If the input inode of hfswriteinode() is incorrect: struct inode struct hfsinodeinfo struct hfscatkey struct hfsname u8 len # len is greater than HFSNAMELEN(31) which is the maximum length of an HFS filename

OOB read occurred: hfswriteinode() hfsbrecfind() _hfsbrecfind() hfscatkeycmp() hfsstrcmp() # OOB read occurred due to len is too large

Fix this by adding a Check on len in hfswriteinode() before calling hfsbrecfind().

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50581.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
8c40f2dbae603ef0bd21e87c63f54ec59fd88256
Fixed
c886c10a6eddb99923b315f42bf63f448883ef9a
Fixed
2344f17c0a89c181ab1a9fef57fd8c3bddfd6e30
Fixed
90103ccb6e60aa4efe48993d23d6a528472f2233
Fixed
4fd3a11804c8877ff11fec59c5c53f1635331e3e
Fixed
367296925c7625c3969d2a78d7a3e1dee161beb5
Fixed
e9e692917c6e10a7066c7a6d092dcdc3d4e329f3
Fixed
bfc9d8f27f89717431a6aecce42ae230b437433f
Fixed
8d824e69d9f3fa3121b2dda25053bae71e2460d2

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50581.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.6.12
Fixed
4.9.337
Type
ECOSYSTEM
Events
Introduced
4.10.0
Fixed
4.14.303
Type
ECOSYSTEM
Events
Introduced
4.15.0
Fixed
4.19.270
Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
5.4.229
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.163
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.86
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.0.16
Type
ECOSYSTEM
Events
Introduced
6.1.0
Fixed
6.1.2

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50581.json"