Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs/ntfs3: fix negative shift size in true_sectors_per_clst()
syzbot is reporting shift-out-of-bounds in true_sectors_per_clst() [1], for commit a3b7743 ("fs/ntfs3: validate BOOT sectors_per_clusters") did not address that (0 - boot->sectors_per_clusters) < 0 because "u8" was chosen for type of boot->sectors_per_clusters because 0x80 needs to be positive in order to support 64K clusters. Use "s8" cast in order to make sure that (0 - (s8) boot->sectors_per_clusters) > 0. Link: https://syzkaller.appspot.com/bug?extid=1631f09646bc214d2e76 [1] Link: https://lkml.kernel.org/r/4b37f037-3b10-b4e4-0644-73441c8fa0af@I-love.SAKURA.ne.jp Fixes: a3b7743 ("fs/ntfs3: validate BOOT sectors_per_clusters") Reported-by: syzbot <syzbot+1631f09646bc214d2e76@syzkaller.appspotmail.com> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Tested-by: syzbot <syzbot+1631f09646bc214d2e76@syzkaller.appspotmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
- Loading branch information