CVE-2023-53988: fs/ntfs3: Fix slab-out-of-bounds read in hdr_delete_de()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
fs/ntfs3: Fix slab-out-of-bounds read in hdr_delete_de()
Here is a BUG report from syzbot:
BUG: KASAN: slab-out-of-bounds in hdr_delete_de+0xe0/0x150 fs/ntfs3/index.c:806 Read of size 16842960 at addr ffff888079cc0600 by task syz-executor934/3631 Call Trace: memmove+0x25/0x60 mm/kasan/shadow.c:54 hdr_delete_de+0xe0/0x150 fs/ntfs3/index.c:806 indx_delete_entry+0x74f/0x3670 fs/ntfs3/index.c:2193 ni_remove_name+0x27a/0x980 fs/ntfs3/frecord.c:2910 ntfs_unlink_inode+0x3d4/0x720 fs/ntfs3/inode.c:1712 ntfs_rename+0x41a/0xcb0 fs/ntfs3/namei.c:276
Before using the meta-data in struct INDEX_HDR, we need to check index header valid or not. Otherwise, the corruptedi (or malicious) fs image can cause out-of-bounds access which could make kernel panic.
The Linux kernel CVE team has assigned CVE-2023-53988 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.15 with commit 82cae269cfa953032fbb8980a7d554d60fb00b17 and fixed in 5.15.111 with commit c58ea97aa94f033ee64a8cb6587d84a9849b6216 Issue introduced in 5.15 with commit 82cae269cfa953032fbb8980a7d554d60fb00b17 and fixed in 6.1.28 with commit 9163a5b4ed290da4a7d23fa92533e0e81fd0166e Issue introduced in 5.15 with commit 82cae269cfa953032fbb8980a7d554d60fb00b17 and fixed in 6.2.15 with commit 114204d25e1dffdd3a0c1cfbba219afd344f4b4f Issue introduced in 5.15 with commit 82cae269cfa953032fbb8980a7d554d60fb00b17 and fixed in 6.3.2 with commit 4a034ece7e2877673d9085d6e7ed45e6ee40b761 Issue introduced in 5.15 with commit 82cae269cfa953032fbb8980a7d554d60fb00b17 and fixed in 6.4 with commit ab84eee4c7ab929996602eda7832854c35a6dda2
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2023-53988
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/ntfs3/fslog.c fs/ntfs3/index.c fs/ntfs3/ntfs_fs.h
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/c58ea97aa94f033ee64a8cb6587d84a9849b6216 https://git.kernel.org/stable/c/9163a5b4ed290da4a7d23fa92533e0e81fd0166e https://git.kernel.org/stable/c/114204d25e1dffdd3a0c1cfbba219afd344f4b4f https://git.kernel.org/stable/c/4a034ece7e2877673d9085d6e7ed45e6ee40b761 https://git.kernel.org/stable/c/ab84eee4c7ab929996602eda7832854c35a6dda2