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

libct: fix some container.Run fd leaks, add fd leak test #2802

Merged
merged 2 commits into from
Mar 31, 2021

Commits on Mar 31, 2021

  1. libct: close execFifo after start

    Apparently, the parent never closes execFifo fd. Not a problem for runc
    per se, but can be an issue for a user of libcontainer.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    b3be2b0 View commit details
    Browse the repository at this point in the history
  2. libct/int: add TestFdLeaks

    This is a very simple test that checks that container.Run do not leak
    opened file descriptors.
    
    In fact it does, so we have to add two exclusions:
    
    1. /sys/fs/cgroup is opened once per lifetime in prepareOpenat2(),
        provided that cgroupv2 is used and openat2 is available. This
        works as intended ("it's not a bug, it's a feature").
    
    2. ebpf program fd is leaked every time we call setDevices() for
       cgroupv2 (iow, every container.Run or container.Set leaks 1 fd).
       This needs to be fixed, thus FIXME.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    79a8647 View commit details
    Browse the repository at this point in the history