mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
fs/ntfs3: Harden against integer overflows
[ Upstream commite001e60869
] Smatch complains that the "add_bytes" is not to be trusted. Use size_add() to prevent an integer overflow. Fixes:be71b5cba2
("fs/ntfs3: Add attrib operations") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
95afb464c8
commit
b259e31d15
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea,
|
|||
return -EFBIG;
|
||||
|
||||
/* Allocate memory for packed Ea. */
|
||||
ea_p = kmalloc(size + add_bytes, GFP_NOFS);
|
||||
ea_p = kmalloc(size_add(size, add_bytes), GFP_NOFS);
|
||||
if (!ea_p)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in a new issue