Dan Carpenter fb7bcd1722 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: be71b5cba2e6 ("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:10:52 +01:00
..
2023-09-28 15:04:01 +03:00
2023-09-28 15:04:06 +03:00
2023-09-28 15:04:01 +03:00
2023-08-02 09:13:09 -06:00
2023-07-03 00:21:27 +04:00
2023-09-28 15:04:01 +03:00
2023-09-28 15:04:01 +03:00
2023-09-28 15:04:01 +03:00
2023-07-03 00:21:27 +04:00
2023-10-19 09:10:18 -07:00
2022-09-30 17:39:47 +03:00