Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

[17.06] backport: Avoid race when opening exec fifo #4

Closed
wants to merge 7 commits into from
Closed

[17.06] backport: Avoid race when opening exec fifo #4

wants to merge 7 commits into from

Commits on Mar 12, 2018

  1. Avoid race when opening exec fifo

    When starting a container with `runc start` or `runc run`, the stub
    process (runc[2:INIT]) opens a fifo for writing. Its parent runc process
    will open the same fifo for reading. In this way, they synchronize.
    
    If the stub process exits at the wrong time, the parent runc process
    will block forever.
    
    This can happen when racing 2 runc operations against each other: `runc
    run/start`, and `runc delete`. It could also happen for other reasons,
    e.g. the kernel's OOM killer may select the stub process.
    
    This commit resolves this race by racing the opening of the exec fifo
    from the runc parent process against the stub process exiting. If the
    stub process exits before we open the fifo, we return an error.
    
    Another solution is to wait on the stub process. However, it seems it
    would require more refactoring to avoid calling wait multiple times on
    the same process, which is an error.
    
    Signed-off-by: Craig Furman <cfurman@pivotal.io>
    (cherry picked from commit 8d3e6c9)
    Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
    williammartin authored and Tibor Vass committed Mar 12, 2018
    Configuration menu
    Copy the full SHA
    f6461a9 View commit details
    Browse the repository at this point in the history
  2. Return from goroutine when it should terminate

    Signed-off-by: Craig Furman <cfurman@pivotal.io>
    (cherry picked from commit 5c0af14)
    Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
    teddyking authored and Tibor Vass committed Mar 12, 2018
    Configuration menu
    Copy the full SHA
    0aa3980 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2018

  1. Do not run shfmt on travis

    Signed-off-by: Tibor Vass <tibor@docker.com>
    andrewhsu authored and Tibor Vass committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    ced7994 View commit details
    Browse the repository at this point in the history
  2. Fix compile errors and port TestParseState

    Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
    Signed-off-by: Tibor Vass <tibor@docker.com>
    andrewhsu authored and Tibor Vass committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    af29c41 View commit details
    Browse the repository at this point in the history
  3. Use go_import_path in travis config

    Signed-off-by: Tibor Vass <tibor@docker.com>
    Tibor Vass committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    2931f19 View commit details
    Browse the repository at this point in the history
  4. tests: allow to load kernel modules from a test container

    CRIU needs to load a few modules to checkpoint/resume containers.
    
    opencontainers#1745
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
    avagin authored and Tibor Vass committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    0aed39c View commit details
    Browse the repository at this point in the history
  5. libcontainer/console_linux.go: Make SaneTerminal public

    And use it only in local tooling that is forwarding the pseudoterminal
    master.  That way runC no longer has an opinion on the onlcr setting
    for folks who are creating a terminal and detaching.  They'll use
    --console-socket and can setup the pseudoterminal however they like
    without runC having an opinion.  With this commit, the only cases
    where runC still has applies SaneTerminal is when *it* is the process
    consuming the master descriptor.
    
    Signed-off-by: W. Trevor King <wking@tremily.us>
    (cherry picked from commit 830c0d7)
    Signed-off-by: Tibor Vass <tibor@docker.com>
    wking authored and Tibor Vass committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    f6bb335 View commit details
    Browse the repository at this point in the history