From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Davide Libenzi <davidel@xmailserver.org>,
Ingo Molnar <mingo@elte.hu>, Roland McGrath <roland@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] change kernel threads to ignore signals instead of blocking them
Date: Fri, 13 Apr 2007 08:13:32 -0600 [thread overview]
Message-ID: <m1bqhspdkj.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070413073116.GA1540@tv-sign.ru> (Oleg Nesterov's message of "Fri, 13 Apr 2007 11:31:16 +0400")
Oleg Nesterov <oleg@tv-sign.ru> writes:
> On top of Eric's
>
> kthread-dont-depend-on-work-queues-take-2.patch
>
> Currently kernel threads use sigprocmask(SIG_BLOCK) to protect against signals.
> This doesn't prevent the signal delivery, this only blocks signal_wake_up().
> Every "killall -33 kthreadd" means a "struct siginfo" leak.
>
> Change kthreadd_setup() to set all handlers to SIG_IGN instead of blocking them
> (make a new helper ignore_signals() for that). If the kernel thread needs some
> signal, it should use allow_signal() anyway, and in that case it should not use
> CLONE_SIGHAND.
>
> Note that we can't change daemonize() (should die!) in the same way, because
> it can be used along with CLONE_SIGHAND. This means that allow_signal() still
> should unblock the signal to work correctly with daemonize()ed threads.
>
> However, disallow_signal() doesn't block the signal any longer but ignores it.
>
> NOTE: with or without this patch the kernel threads are not protected from
> handle_stop_signal(), this seems harmless, but not good.
Hmm. I like it all except for disallow_signal.
disallow_signal currently only has one user, jffs2. While jffs2
currently doesn't care, given the way jffs2 is using disallow_signal I
would expect it would prefer to have the signal blocked.
Thinking about this some more if jffs2 or anyone else wants blocked
signal behavior they can go ahead and block the signal. Keeping
disallow_signal in sync with allow_signal seems to make sense.
Nothing in the kernel should break with this change so:
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
next prev parent reply other threads:[~2007-04-13 14:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-13 7:31 Oleg Nesterov
2007-04-13 14:13 ` Eric W. Biederman [this message]
2007-04-13 21:08 ` Andrew Morton
2007-04-13 21:36 ` Eric W. Biederman
2007-04-24 2:45 ` Andrew Morton
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=m1bqhspdkj.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=roland@redhat.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
Powered by JetHome