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

mountinfo: linux: add a /proc/self/mountinfo fallback #135

Merged
merged 1 commit into from Nov 7, 2023

Commits on Nov 6, 2023

  1. mountinfo: linux: add a /proc/self/mountinfo fallback

    In very specific cases (that we hit in runc), it is possible to be
    running in a child pid namespace (where the Go process's pid is 1) but
    still have a host /proc. While this is not a problem with
    /proc/thread-self (since the process *is* in the host pid namespace),
    the /proc/self/task/<tid> fallback doesn't work because gettid(2)
    returns the wrong thread-id for the host pid namespace.
    
    There isn't much we can do in this case other than use /proc/self,
    because the simple workarounds (grep NSpid /proc/self/task/*/status)
    aren't available in pre-3.17 kernels and any more complicated schemes
    (such as setting the signal mask to something unique and scanning for
    it) are unworkable for obvious reasons.
    
    Fixes: 12c61a3 ("mountinfo: linux: use /proc/thread-self/mountinfo")
    Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
    cyphar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    6c165c1 View commit details
    Browse the repository at this point in the history