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 #4138

Merged
merged 1 commit into from
Oct 28, 2024

Commits on Oct 26, 2024

  1. FileManagement: Hide the FEX RootFS fd from /proc/self/fd

    Chromium/CEF has code that iterates through all open FDs and bails if
    any are directories (apparently a sandboxing sanity check). To avoid
    this check, we need to hide the RootFS FD. This requires hooking all the
    getdents variants to skip that entry.
    
    To keep the runtime cost low, we keep track of the inode of
    /proc/self/fd/<rootfs fd> (note: not the RootFS inode, the inode of the
    magic symlink in /proc), and first do a quick check on that. If it
    matches, then we stat the dirfd we are reading and check against the
    procfs device, to complete the inode equality check.
    
    As an extra benefit, this also fixes code that tries to iterate and
    close all/extra FDs and ends up closing the RootFS fd.
    asahilina committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    3d701f5 View commit details
    Browse the repository at this point in the history