In the Linux kernel, the following vulnerability has been resolved:
hfs: fix OOB Read in _hfsbrec_find
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 write_inode 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().
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50581.json"
}