From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] kill_something_info: misc cleanups
Date: Tue, 19 Dec 2006 00:24:24 +0300 [thread overview]
Message-ID: <20061218212424.GB520@tv-sign.ru> (raw)
In-Reply-To: <m1irg9s64t.fsf@ebiederm.dsl.xmission.com>
On 12/18, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@tv-sign.ru> writes:
>
> > Btw, de_thread() already takes care about multithread init, but
> > get_signal_to_deliver() does not:
> >
> > if (current == child_reaper(current))
> > continue;
>
> Probably just: current->group_leader == child_reaper(current).
No. deadlock on exec.
> Can we do the ignore in send_signal?
No. It is not possible immediately with the current implemantation,
but the main reason is that we want to retain the "init is protected
from all signals it doesn't explicitly setup a signal handler for"
property. Consider init doing
signal(SIGTERM, handler);
...
signal(SIGTERM, SIG_DFL); <----- SIGTERM comes
so we should do something for init on receive-signal path. Yes, yes,
we _can_ solve this in other way (say, change sys_rt_sigaction), but
this is nasty and doesn't solve other problems.
> > This doesn't protect init from SIGKILL if we send it to sub-thread (and
> > this can happen even if we use kill(1, sig), not tkill). Yes, the main
> > thread will survive, but still this is not what we want. SIGSTOP will
> > manage to stop entire group because sub-thread sets ->group_stop_count.
>
> Yep. We need to fix this. It doesn't happen today because we don't
> have a multi-threaded init. But as soon as untrusted users can have
> their own init this becomes we need to handle everything properly.
This is a longstanding problem, an it is connected to other longstanding
problems (say, fatal signal may be lost on exec). I wish I had a time to
at least try to find a solution.
Probably I'll find some time at the beginning of January, I have some
vague ideas. Hmm... at least I had :)
> We need two specific helpers.
> 1) To detect the real machine init and the special things we have to
> do for it.
> 2) To detect the init of a pid namespace for user visible semantic
> purposes like signal handling (is there anything else).
Yes, I understand. My intent was to push this cleanup before multiple
pid namespaces will change kill_something_inf(). But as I said it is
minor, and since you and Christoph don't like it (for whatever reason)
please forget it.
Oleg.
prev parent reply other threads:[~2006-12-18 21:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-16 20:05 Oleg Nesterov
2006-12-16 23:10 ` Eric W. Biederman
2006-12-17 0:37 ` Oleg Nesterov
2006-12-17 1:09 ` Eric W. Biederman
2006-12-17 10:18 ` Christoph Hellwig
2006-12-17 11:22 ` Eric W. Biederman
2006-12-17 14:40 ` Oleg Nesterov
2006-12-18 13:09 ` Eric W. Biederman
2006-12-18 21:24 ` Oleg Nesterov [this message]
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=20061218212424.GB520@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®