From: Philipp Hahn Date: Tue, 3 Mar 2026 10:59:14 +0000 (+0100) Subject: exfat: Fix bitwise operation having different size X-Git-Tag: v7.1-rc1~227^2~15 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=3dce5bb82c97fc2ac28d80d496120a6525ce3fb7;p=thirdparty%2Fkernel%2Flinux.git exfat: Fix bitwise operation having different size cpos has type loff_t (long long), while s_blocksize has type u32. The inversion wil happen on u32, the coercion to s64 happens afterwards and will do 0-left-paddding, resulting in the upper bits getting masked out. Cast s_blocksize to loff_t before negating it. Found by static code analysis using Klocwork. Signed-off-by: Philipp Hahn Signed-off-by: Namjae Jeon --- diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 3a4853693d8bf..e710dd196e2f0 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -249,7 +249,7 @@ get_new: */ if (err == -EIO) { cpos += 1 << (sb->s_blocksize_bits); - cpos &= ~(sb->s_blocksize - 1); + cpos &= ~(loff_t)(sb->s_blocksize - 1); } err = -EIO;