linux/fs/ntfs3
Abdun Nihaal 019d22eb0e
fs/ntfs3: Validate attribute data and valid sizes
The data_size and valid_size fields of non resident attributes should be
less than the its alloc_size field, but this is not checked in
ntfs_read_mft function.

Syzbot reports a allocation order warning due to a large unchecked value
of data_size getting assigned to inode->i_size which is then passed to
kcalloc.

Add sanity check for ensuring that the data_size and valid_size fields
are not larger than alloc_size field.

Link: https://syzkaller.appspot.com/bug?extid=fa4648a5446460b7b963
Reported-and-tested-by: syzbot+fa4648a5446460b7b963@syzkaller.appspotmail.com
Fixes: (82cae269cf) fs/ntfs3: Add initialization of super block
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
2022-11-12 20:59:41 +03:00
..
lib fs/ntfs3: Add missing header and guards to lib/ headers 2021-09-13 19:41:44 +03:00
attrib.c fs/ntfs3: Fix attr_punch_hole() null pointer derenference 2022-09-30 17:39:50 +03:00
attrlist.c fs/ntfs3: Validate data run offset 2022-09-30 17:39:49 +03:00
bitfunc.c fs/ntfs3: Remove a useless shadowing variable 2021-09-23 19:05:46 +03:00
bitmap.c fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init() 2022-11-12 20:59:41 +03: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: Validate data run offset 2022-09-30 17:39:49 +03:00
fslog.c fs/ntfs3: Validate data run offset 2022-09-30 17:39:49 +03:00
fsntfs.c fs/ntfs3: Validate index root when initialize NTFS security 2022-11-12 20:59:30 +03:00
index.c fs/ntfs3: Validate buffer length while parsing index 2022-09-30 17:39:54 +03:00
inode.c fs/ntfs3: Validate attribute data and valid sizes 2022-11-12 20:59:41 +03: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: Don't use uni1 uninitialized in ntfs_d_compare() 2022-10-26 19:32:02 +03:00
ntfs_fs.h fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
ntfs.h fs/ntfs3: Change max hardlinks limit to 4000 2021-09-21 18:37:01 +03:00
record.c fs/ntfs3: Validate resident attribute name 2022-09-30 17:39:54 +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: Use __GFP_NOWARN allocation at ntfs_fill_super() 2022-11-12 20:59:41 +03:00
upcase.c fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
xattr.c fs/ntfs3: Use strcmp to determine attribute type 2022-09-30 17:39:55 +03:00