]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ntfs: fix potential 32-bit truncation in ntfs_write_cb()
authorDan Carpenter <error27@gmail.com>
Fri, 10 Apr 2026 15:24:49 +0000 (00:24 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Sat, 18 Apr 2026 02:33:21 +0000 (11:33 +0900)
commit660b982305cebd242df52fe87adf6b203a12f9be
tree0c86d77909206128225604e893e2e03a27ec3704
parentdacc18029ef69ed225fdb4d7c3215c285e9e8ef4
ntfs: fix potential 32-bit truncation in ntfs_write_cb()

Smatch warned that the bitwise negation in ntfs_write_cb() might lead to
unintended truncation. Casting the block size to loff_t before bitwise
negation prevents the upper 32 bits of pos from being incorrectly zeroed
out during the calculation of new_vcn.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/compress.c