Page MenuHomeFreeBSD

D33029.diff
No OneTemporary

D33029.diff

diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c
--- a/sys/fs/ext2fs/ext2_vfsops.c
+++ b/sys/fs/ext2fs/ext2_vfsops.c
@@ -465,6 +465,13 @@
int g_count = 0;
int error;
+ /* Check if first dblock is valid */
+ if (fs->e2fs->e2fs_bcount >= 1024 && fs->e2fs->e2fs_first_dblock) {
+ SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error,
+ "first dblock is invalid");
+ return (EINVAL);
+ }
+
/* Check checksum features */
if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) &&
EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) {
@@ -611,7 +618,8 @@
return (EINVAL);
}
- if (le32toh(es->e2fs_first_dblock) >= fs->e2fs_bcount) {
+ if (le32toh(es->e2fs_first_dblock) != (fs->e2fs_bsize > 1024 ? 0 : 1) ||
+ le32toh(es->e2fs_first_dblock) >= fs->e2fs_bcount) {
SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error,
"first data block out of range");
return (EINVAL);

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 5:47 AM (20 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15927689
Default Alt Text
D33029.diff (953 B)

Event Timeline