Skip to content

Commit b8752ed

Browse files
committed
Fix capability bound issue in ext2fs
1 parent 5a73626 commit b8752ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sys/fs/ext2fs/ext2_htree.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ ext2_htree_find_leaf(struct inode *ip, const char *name, int namelen,
300300
if ((levels = rootp->h_info.h_ind_levels) > 1)
301301
goto error;
302302

303-
entp = (struct ext2fs_htree_entry *)(((char *)&rootp->h_info) +
303+
// Preserve capability bound here
304+
entp = (struct ext2fs_htree_entry *)(((char *)rootp) + offsetof(struct ext2fs_htree_root, h_info) +
304305
rootp->h_info.h_info_len);
305306

306307
if (ext2_htree_get_limit(entp) !=

0 commit comments

Comments
 (0)