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

FileManagement: Hide the FEX RootFS fd from /proc/self/fd take 2 #4158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asahilina
Copy link
Contributor

Apparently Chromium/CEF can chroot or otherwise sandbox the filesystem away before forking and checking for directory FDs, making /proc inaccessible, which means we can't stat it for our inode check, breaking the hiding.

So, double down on things and do what Chromium does: open an fd to /proc ahead of time, so that continues to work. Then we use it to update the inode of our RootFS fd instead, and finally, also do the /proc fd itself to hide that one too.

We also don't need to check the st_dev of /proc more than once, since that's not expected to change anyway.

Fixes cefsimple.

Apparently Chromium/CEF can chroot or otherwise sandbox the filesystem
away before forking and checking for directory FDs, making /proc
inaccessible, which means we can't stat it for our inode check, breaking
the hiding.

So, double down on things and do what Chromium does: open an fd to /proc
ahead of time, so that continues to work. Then we use it to update the
inode of our RootFS fd instead, and finally, also do the /proc fd itself
to hide that one too.

We also don't need to check the st_dev of /proc more than once, since
that's not expected to change anyway.

Fixes cefsimple.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant