Whamcloud - gitweb
libext2fs: teach ext2fs_open() to reject file systems with an invalid flex_bg size
authorTheodore Ts'o <tytso@mit.edu>
Sat, 6 Aug 2022 06:21:49 +0000 (02:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 6 Aug 2022 06:21:49 +0000 (02:21 -0400)
commit80e1504f2ce33c9ebc5045009c7bcde9315526c0
tree7482f8e990668ca300035339a061d6bfc000360b
parent2a2b9ceb99c226952a96abbcfb95b2540f8b7ecd
libext2fs: teach ext2fs_open() to reject file systems with an invalid flex_bg size

If s_log_groups_per_flex is greater than 31, it will result in an
UBSAN error, since it will result in an invalid shift exponent when
calculating the flex_bg size.  So reject such file systems when they
are opened.  (The mke2fs program will not allow the creation of such
file systems, so they can only occur due to corruption.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/openfs.c