public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: vcaputo@gnugeneration.com
To: linux-kernel@vger.kernel.org
Cc: vito.caputo@coreos.com
Subject: PROBLEM: Namespaced PID 1 ignoring SIG_DFL signals
Date: Fri, 20 Feb 2015 15:39:10 -0600	[thread overview]
Message-ID: <20150220213910.GE8947@shells.gnugeneration.com> (raw)

Hello lkml,

According to the comment:

> * Note that if global/container-init sees a sig_kernel_only()
> * signal here, the signal must have been generated internally
> * or must have come from an ancestor namespace. In either
> * case, the signal cannot be dropped.

[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/signal.c?id=refs/tags/v3.19#n2290]

Killing a container's PID1 shouldn't be ignored when the default-handled
signal originated from an ancestor namespace or internally.

When executing via `unshare --fork --pid` a trivial "for(;;) pause();" C
program that installs no signal handlers,  then sending SIGTERM to the
namespaced process from the parent namespace, the pause() syscall just
returns EINTR and loops rather than the process terminating.

This does not seem consistent with the intention documented in the code.

Additionally, if using a more comprehensive executor than unshare which
allocates a pty for the child and sets the pty slave as the controlling
tty pre-exec, running the same test the signals delivered by the pty
slave are identically ignored.  It's unclear to me whether signals
originating from the process' own controlling tty would be classified as
"generated internally".

IMHO both of these scenarios should result in the signal being handled,
but if that's inappropriate I'd appreciate any clarification.

Please CC me with any responses, as I'm not subscribed.

Thanks,
Vito Caputo

                 reply	other threads:[~2015-02-20 21:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150220213910.GE8947@shells.gnugeneration.com \
    --to=vcaputo@gnugeneration.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vito.caputo@coreos.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox