[lxc-devel] [lxc/lxc] 9cb943: fix signal sending in lxc.init

GitHub noreply at github.com
Thu Apr 5 21:03:46 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 9cb943843a70cef5478d224615ca53c315020ef3
      https://github.com/lxc/lxc/commit/9cb943843a70cef5478d224615ca53c315020ef3
  Author: Tycho Andersen <tycho at tycho.ws>
  Date:   2018-04-04 (Wed, 04 Apr 2018)

  Changed paths:
    M src/lxc/start.c

  Log Message:
  -----------
  fix signal sending in lxc.init

The problem here is that these two clauses were ordered backwards: we first
check if the signal came from not the init pid, and if it did, then we give
a notice and return. The comment notes that this is intended to protect
against SIGCHLD, but we don't in fact know if the signal is a SIGCHLD yet,
because that's tested in the next hunk.

The symptom is that if I e.g. send SIGTERM from the outside world to the
container init, it ignores it and gives this notice. If we re-order these
clauses, it forwards non SIGCHLD signals, and ignores SIGCHLD signals from
things that aren't the real container process.

Signed-off-by: Tycho Andersen <tycho at tycho.ws>


  Commit: 83ffaa1d39096ee2897c6f35d523a819698d1daa
      https://github.com/lxc/lxc/commit/83ffaa1d39096ee2897c6f35d523a819698d1daa
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2018-04-05 (Thu, 05 Apr 2018)

  Changed paths:
    M src/lxc/start.c

  Log Message:
  -----------
  Merge pull request #2258 from tych0/fix-signal-sending-to-lxc-init

fix signal sending in lxc.init


Compare: https://github.com/lxc/lxc/compare/22b2b9c87cd6...83ffaa1d3909


More information about the lxc-devel mailing list