Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115913003
D38502.id119038.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
979 B
Referenced Files
None
Subscribers
None
D38502.id119038.diff
View Options
diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c
--- a/sys/fs/ext2fs/ext2_lookup.c
+++ b/sys/fs/ext2fs/ext2_lookup.c
@@ -818,6 +818,8 @@
* record must be large enough to contain entry
* name is not longer than MAXNAMLEN
* name must be as long as advertised, and null terminated
+ * inode number less then inode count
+ * if root inode entry, it have correct name
*/
static int
ext2_check_direntry(struct vnode *dp, struct ext2fs_direct_2 *de,
@@ -836,6 +838,11 @@
error_msg = "directory entry across blocks";
else if (le32toh(de->e2d_ino) > fs->e2fs->e2fs_icount)
error_msg = "directory entry inode out of bounds";
+ else if (le32toh(de->e2d_ino) == EXT2_ROOTINO &&
+ ((de->e2d_namlen != 1 && de->e2d_namlen != 2) ||
+ (de->e2d_name[0] != '.') ||
+ (de->e2d_namlen == 2 && de->e2d_name[1] != '.')))
+ error_msg = "bad root directory entry";
if (error_msg != NULL) {
SDT_PROBE5(ext2fs, , trace, ext2_dirbadentry_error,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 1, 8:16 AM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17877397
Default Alt Text
D38502.id119038.diff (979 B)
Attached To
Mode
D38502: Add root directory entry check.
Attached
Detach File
Event Timeline
Log In to Comment