acrn-kernel/fs/ntfs3
Dan Carpenter ec1bedd797 fs/ntfs3: Fix an NULL dereference bug
[ Upstream commit b2dd7b953c25ffd5912dda17e980e7168bebcf6c ]

The issue here is when this is called from ntfs_load_attr_list().  The
"size" comes from le32_to_cpu(attr->res.data_size) so it can't overflow
on a 64bit systems but on 32bit systems the "+ 1023" can overflow and
the result is zero.  This means that the kmalloc will succeed by
returning the ZERO_SIZE_PTR and then the memcpy() will crash with an
Oops on the next line.

Fixes: be71b5cba2 ("fs/ntfs3: Add attrib operations")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-16 19:06:28 +01:00
..
lib
Kconfig
Makefile
attrib.c fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() 2023-11-08 14:10:59 +01:00
attrlist.c fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) 2023-11-08 14:10:58 +01:00
bitfunc.c
bitmap.c fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) 2023-11-08 14:10:58 +01:00
debug.h
dir.c fs/ntfs3: Fix directory element type detection 2023-11-08 14:10:59 +01:00
file.c
frecord.c fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() 2023-11-08 14:10:58 +01:00
fslog.c fs/ntfs3: Avoid possible memory leak 2023-11-08 14:10:59 +01:00
fsntfs.c
index.c
inode.c
lznt.c
namei.c
ntfs.h
ntfs_fs.h fs/ntfs3: Fix an NULL dereference bug 2024-02-16 19:06:28 +01:00
record.c
run.c
super.c fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) 2023-11-08 14:10:58 +01:00
upcase.c
xattr.c