Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext2fs: Fix capability bound issue in ext2fs #2294

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sys/fs/ext2fs/ext2_htree.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ 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) +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we want to use __unbounded_addressof here from sys/cdefs.h? This is what we generally have been using for sub-object bounds related things.

offsetof(struct ext2fs_htree_root, h_info) +
rootp->h_info.h_info_len);

if (ext2_htree_get_limit(entp) !=
Expand Down