Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs/ntfs3: validate BOOT sectors_per_clusters
When the NTFS BOOT sectors_per_clusters field is > 0x80, it represents a shift value. Make sure that the shift value is not too large before using it (NTFS max cluster size is 2MB). Return -EVINVAL if it too large. This prevents negative shift values and shift values that are larger than the field size. Prevents this UBSAN error: UBSAN: shift-out-of-bounds in ../fs/ntfs3/super.c:673:16 shift exponent -192 is negative Link: https://lkml.kernel.org/r/[email protected] Fixes: 82cae26 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Randy Dunlap <[email protected]> Reported-by: [email protected] Reviewed-by: Namjae Jeon <[email protected]> Cc: Konstantin Komarov <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Kari Argillander <[email protected]> Cc: Namjae Jeon <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
- Loading branch information