-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libext2fs: always refuse to open a file system with a zero s_desc_size
Commit 42c11ed ("ext2fs_open[2](), return an error if s_desc_size is too large") added a check for an insanely large s_desc_size to prevent some failures triggered by fuzz testing. However, it would allow e2fsck to fall back to recover the file system by using the backup superblocks by having e2fsck pass the flag EXT2_FLAG_IGNORE_SB_ERRORS. But by allowing an s_desc_Size of zero, it's possible that e2fsck will die with a division of zero error. With this fix, e2fsck will now print an error message and exit instead. #183 Fixes: 42c11ed ("ext2fs_open[2](), return an error if s_desc_size is too large") Signed-off-by: Theodore Ts'o <[email protected]>
- Loading branch information
Showing
5 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
../e2fsck/e2fsck: Block group descriptor size incorrect while trying to open test.img | ||
../e2fsck/e2fsck: Trying to load superblock despite errors... | ||
../e2fsck/e2fsck: Block group descriptor size incorrect while trying to open test.img | ||
|
||
The superblock could not be read or does not describe a valid ext2/ext3/ext4 | ||
filesystem. If the device is valid and it really contains an ext2/ext3/ext4 | ||
filesystem (and not swap or ufs or something else), then the superblock | ||
is corrupt, and you might try running e2fsck with an alternate superblock: | ||
e2fsck -b 8193 <device> | ||
or | ||
e2fsck -b 32768 <device> | ||
|
||
Exit status is 8 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zero s_desc_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ONE_PASS_ONLY="true" | ||
. $cmd_dir/run_e2fsck |