Erofs probe can use undefined shift if blkszbits
is a bogus value. Avoid this by limiting shift size.
Reproducer found with OSS-Fuzz (issue 52298) running over
cryptsetup project (blkid is used in header init).
Signed-off-by: Karel Zak <kzak@redhat.com>
return errno ? -errno : BLKID_PROBE_NONE;
/* EROFS is restricted to 4KiB block size */
- if ((1U << sb->blkszbits) > 4096)
+ if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 4096)
return BLKID_PROBE_NONE;
if (!erofs_verify_checksum(pr, mag, sb))