Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107791948
D33029.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
953 B
Referenced Files
None
Subscribers
None
D33029.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D33029: ext2: Check for e2fs_first_dblock in ext2_compute_sb_data()
Attached
Detach File
Event Timeline
Log In to Comment