Skip to content

Commit

Permalink
Fix capability bound issue in ext2fs
Browse files Browse the repository at this point in the history
  • Loading branch information
w4123 committed Jan 16, 2025
1 parent 5a73626 commit b8752ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys/fs/ext2fs/ext2_htree.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ ext2_htree_find_leaf(struct inode *ip, const char *name, int namelen,
if ((levels = rootp->h_info.h_ind_levels) > 1)
goto error;

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

if (ext2_htree_get_limit(entp) !=
Expand Down

0 comments on commit b8752ed

Please sign in to comment.