]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs/ntfs3: Prevent integer overflow in hdr_first_de()
authorDan Carpenter <dan.carpenter@linaro.org>
Sun, 16 Feb 2025 20:52:10 +0000 (23:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:33 +0000 (14:37 +0200)
commitf6d44b1aa46d317e52c21fb9314cfb20dd69e7b0
tree7c48dd12f2e619ee95a39fbc11247d5e1a0b9060
parent0dfe700fbd3525f30a36ffbe390a5b9319bd009a
fs/ntfs3: Prevent integer overflow in hdr_first_de()

[ Upstream commit 6bb81b94f7a9cba6bde9a905cef52a65317a8b04 ]

The "de_off" and "used" variables come from the disk so they both need to
check.  The problem is that on 32bit systems if they're both greater than
UINT_MAX - 16 then the check does work as intended because of an integer
overflow.

Fixes: 60ce8dfde035 ("fs/ntfs3: Fix wrong if in hdr_first_de")
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>
fs/ntfs3/ntfs.h