Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/ext2fs/ext2_extents.c
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | ext4_ext_check_header(struct inode *ip, struct ext4_extent_header *eh) | ||||
if (eh->eh_max == 0) { | if (eh->eh_max == 0) { | ||||
error_msg = "header: invalid eh_max"; | error_msg = "header: invalid eh_max"; | ||||
goto corrupted; | goto corrupted; | ||||
} | } | ||||
if (le16toh(eh->eh_ecount) > le16toh(eh->eh_max)) { | if (le16toh(eh->eh_ecount) > le16toh(eh->eh_max)) { | ||||
error_msg = "header: invalid eh_entries"; | error_msg = "header: invalid eh_entries"; | ||||
goto corrupted; | goto corrupted; | ||||
} | } | ||||
if (eh->eh_depth > 5) { | |||||
error_msg = "header: invalid eh_depth"; | |||||
goto corrupted; | |||||
} | |||||
return (0); | return (0); | ||||
corrupted: | corrupted: | ||||
SDT_PROBE2(ext2fs, , trace, extents, 1, error_msg); | SDT_PROBE2(ext2fs, , trace, extents, 1, error_msg); | ||||
return (EIO); | return (EIO); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,321 Lines • Show Last 20 Lines |