linux/fs/ntfs3
Jiasheng Jiang 78942172d5 fs/ntfs3: Fix slab-out-of-bounds read in DeleteIndexEntryRoot
[ Upstream commit b2bc7c44ed ]

In the 'DeleteIndexEntryRoot' case of the 'do_action' function, the
entry size ('esize') is retrieved from the log record without adequate
bounds checking.

Specifically, the code calculates the end of the entry ('e2') using:
    e2 = Add2Ptr(e1, esize);

It then calculates the size for memmove using 'PtrOffset(e2, ...)',
which subtracts the end pointer from the buffer limit. If 'esize' is
maliciously large, 'e2' exceeds the used buffer size. This results in
a negative offset which, when cast to size_t for memmove, interprets
as a massive unsigned integer, leading to a heap buffer overflow.

This commit adds a check to ensure that the entry size ('esize') strictly
fits within the remaining used space of the index header before performing
memory operations.

Fixes: b46acd6a6a ("fs/ntfs3: Add NTFS journal")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-02-26 14:59:36 -08:00
..
lib Changes for 6.12-rc3 2024-10-08 10:53:06 -07:00
attrib.c fs/ntfs3: remove ability to change compression on mounted volume 2025-05-19 11:17:33 +02:00
attrlist.c fs/ntfs3: Remove unused al_delete_le 2024-10-01 12:19:05 +03:00
bitfunc.c fs/ntfs3: Add ntfs_bitmap_weight_le function and refactoring 2022-11-14 19:50:42 +03:00
bitmap.c fs/ntfs3: Fix a resource leak bug in wnd_extend() 2025-09-10 11:01:40 +02:00
debug.h fs/ntfs3. Add forward declarations for structs to debug.h 2021-09-13 19:41:43 +03:00
dir.c fs/ntfs3: Add sanity check for file name 2025-06-23 19:23:03 +02:00
file.c fs/ntfs3: prevent infinite loops caused by the next valid being the same 2026-02-26 14:59:36 -08:00
frecord.c ntfs: Do not overwrite uptodate pages 2026-01-08 10:16:52 +01:00
fslog.c fs/ntfs3: Fix slab-out-of-bounds read in DeleteIndexEntryRoot 2026-02-26 14:59:36 -08:00
fsntfs.c ntfs3: fix uninit memory after failed mi_read in mi_format_new 2025-12-18 14:02:31 +01:00
index.c fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist 2025-09-10 11:01:41 +02:00
inode.c fs/ntfs3: Initialize allocated memory before use 2025-12-18 14:02:56 +01:00
Kconfig ntfs3: serve as alias for the legacy ntfs driver 2024-04-16 10:45:26 +02:00
lznt.c fs/ntfs3: Check if more than chunk-size bytes are written 2024-09-03 16:58:39 +03:00
Makefile fs/ntfs3: Add Kconfig, Makefile and doc 2021-08-13 07:56:37 -07:00
namei.c fs/ntfs3: Exclude call make_bad_inode for live nodes. 2025-07-07 14:35:46 +02:00
ntfs.h fs/ntfs3: fix symlinks cannot be handled correctly 2025-06-23 19:22:32 +02:00
ntfs_fs.h fs/ntfs3: Support timestamps prior to epoch 2026-01-02 12:56:40 +01:00
record.c fs/ntfs3: Mark inode as bad as soon as error detected in mi_enum_attr() 2024-12-30 11:37:39 +03:00
run.c fs/ntfs3: fix mount failure for sparse runs in run_unpack() 2026-01-02 12:57:09 +01:00
super.c ntfs: set dummy blocksize to read boot_block when mounting 2026-01-02 12:56:40 +01:00
upcase.c fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
xattr.c fs/ntfs3: Exclude call make_bad_inode for live nodes. 2025-07-07 14:35:46 +02:00