linux-stable/fs/ntfs3
Abdun Nihaal f2e58e9527 fs/ntfs3: Fix slab-out-of-bounds read in ntfs_trim_fs
[ Upstream commit 557d19675a ]

Syzbot reports an out of bound access in ntfs_trim_fs.
The cause of this is using a loop termination condition that compares
window index (iw) with wnd->nbits instead of wnd->nwnd, due to which the
index used for wnd->free_bits exceeds the size of the array allocated.

Fix the loop condition.

Fixes: 3f3b442b5a ("fs/ntfs3: Add bitmap")
Link: https://syzkaller.appspot.com/bug?extid=b892240eac461e488d51
Reported-by: syzbot+b892240eac461e488d51@syzkaller.appspotmail.com
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:49 +01:00
..
lib fs/ntfs3: Add missing header and guards to lib/ headers 2021-09-13 19:41:44 +03:00
attrib.c fs/ntfs3: Refactoring attr_insert_range to restore after errors 2022-08-03 18:25:09 +03:00
attrlist.c fs/ntfs3: Add sync flag to ntfs_sb_write_run and al_update 2021-09-21 18:37:01 +03:00
bitfunc.c fs/ntfs3: Remove a useless shadowing variable 2021-09-23 19:05:46 +03:00
bitmap.c fs/ntfs3: Fix slab-out-of-bounds read in ntfs_trim_fs 2022-12-31 13:32:49 +01: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: Rework ntfs_utf16_to_nls 2021-10-11 19:28:04 +03:00
file.c ntfs3 for 6.0 2022-08-17 14:51:22 -07:00
frecord.c fs/ntfs3: Make ni_ins_new_attr return error 2022-08-03 18:25:10 +03:00
fslog.c treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
fsntfs.c ntfs3 for 6.0 2022-08-17 14:51:22 -07:00
index.c fs/ntfs3: extend ni_insert_nonresident to return inserted ATTR_LIST_ENTRY 2022-08-03 18:25:04 +03:00
inode.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
Kconfig
lznt.c fs/ntfs3: Remove tabs before spaces from comment 2021-09-16 17:01:36 +03:00
Makefile
namei.c fs/ntfs3: New function ntfs_bad_inode 2022-08-03 18:25:08 +03:00
ntfs.h fs/ntfs3: Change max hardlinks limit to 4000 2021-09-21 18:37:01 +03:00
ntfs_fs.h ntfs3 for 6.0 2022-08-17 14:51:22 -07:00
record.c fs/ntfs3: Remove unused mi_mark_free 2022-08-03 18:25:06 +03:00
run.c fs/ntfs3: Refactoring attr_punch_hole to restore after errors 2022-08-03 18:25:09 +03:00
super.c fs/ntfs3: Avoid UBSAN error on true_sectors_per_clst() 2022-12-31 13:32:46 +01:00
upcase.c fs/ntfs3: Change right headers to upcase.c 2021-09-13 19:41:45 +03:00
xattr.c fs/ntfs3: Harden against integer overflows 2022-12-31 13:32:46 +01:00