linux/fs/ntfs3
Dan Carpenter ec1bedd797 fs/ntfs3: Fix an NULL dereference bug
[ Upstream commit b2dd7b953c ]

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>
History 2024-02-16 19:06:28 +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: 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 fs/ntfs3: Remove a useless shadowing variable 2021-09-23 19:05:46 +03:00
bitmap.c fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) 2023-11-08 14:10:58 +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: Fix directory element type detection 2023-11-08 14:10:59 +01:00
file.c fs/ntfs3: don't hold ni_lock when calling truncate_setsize() 2023-01-12 12:02:28 +01:00
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 fs/ntfs3: Write immediately updated ntfs state 2023-11-08 14:10:58 +01:00
index.c fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() 2023-10-25 12:03:05 +02:00
inode.c fs/ntfs3: Check fields while reading 2023-07-23 13:49:27 +02:00
Kconfig fs/ntfs3: Add Kconfig, Makefile and doc 2021-08-13 07:56:37 -07:00
lznt.c fs/ntfs3: Remove tabs before spaces from comment 2021-09-16 17:01:36 +03:00
Makefile fs/ntfs3: Add Kconfig, Makefile and doc 2021-08-13 07:56:37 -07:00
namei.c fs/ntfs3: Refactoring of various minor issues 2023-05-17 11:53:51 +02:00
ntfs.h fs/ntfs3: Refactoring of various minor issues 2023-05-17 11:53:51 +02:00
ntfs_fs.h fs/ntfs3: Fix an NULL dereference bug 2024-02-16 19:06:28 +01:00
record.c fs/ntfs3: Mark ntfs dirty when on-disk struct is corrupted 2023-08-23 17:52:26 +02:00
run.c fs/ntfs3: Check fields while reading 2023-07-23 13:49:27 +02:00
super.c fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) 2023-11-08 14:10:58 +01:00
upcase.c fs/ntfs3: Change right headers to upcase.c 2021-09-13 19:41:45 +03:00
xattr.c fs/ntfs3: fix panic about slab-out-of-bounds caused by ntfs_list_ea() 2023-10-25 12:03:05 +02:00