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

[1.1] Fixes inability to use /dev/null when inside a container #3620

Merged
merged 1 commit into from
Oct 21, 2022

Commits on Oct 19, 2022

  1. Fixes inability to use /dev/null when inside a container

    This is a forward port of opencontainers#3620
    
    The original code depended on the origin filesystem to have
    /dev/{block,char} populated. This is done by udev normally and while is
    very common non-containerized systemd installs, it's very easy to start
    systemd in a container created by runc itself and not have
    /dev/{block,char} populated. When this occurs, the following error
    output is observed:
    
    $ docker run hello-world
    docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error reopening /dev/null inside container: open /dev/null: operation not permitted: unknown.
    
    /dev/null can't be opened because it was not added to the
    deviceAllowList, as there was no /dev/char directory. The change here
    utilizes the fact that when sysfs in in use, there is a
    /sys/dev/{block,char} that is kernel maintained that we can check.
    
    Signed-off-by: Evan Phoenix <evan@phx.io>
    (cherry picked from commit 462e719)
    evanphx committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    3b95828 View commit details
    Browse the repository at this point in the history