All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: "Dmitry ADAMUSHKA (EXT)" <dmitry.adamushka_ext@softathome.com>
Cc: Ingo Molnar <mingo@elte.hu>, Ralf Baechle <ralf@linux-mips.org>,
	wouter.cloetens@softathome.com,
	dmitry adamushko <dmitry.adamushko@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: 'khelper' (child) is stuck in endless loop: do_signal() and !user_mode(regs)
Date: Wed, 7 Mar 2012 19:46:15 +0100	[thread overview]
Message-ID: <20120307184615.GA29005@redhat.com> (raw)
In-Reply-To: <1830531676.59669.1331142673402.JavaMail.root@storentr1.softathome.com>

Hi Dmitry,

I can't read this email carefully now, will do tomorrow.

But,

On 03/07, Dmitry ADAMUSHKA (EXT) wrote:
>
> Now, the assumptions (the question is whether these are true for the recent kernels):
>
> 1) TIF_SIGPENDING can be set for 'khelper' while it's running in ____call_usermodehelper()
>    between (a) flush_signal_handlers() and (b) kernel_execve() => so TIF_SIGPENDING is set;

Yes, but it is not khelper. It is another kernel thread. Yes, its
->comm[] was copied from parent, so ps/etc can show it as khelper.

> 2) kernel_execve() can fail in ____call_usermodehelper().
>
> The later one is less of an assumption; let's say, it fails due to a shortage of memory (or whatever).
>
> If (1) is true, then
>
> the pre-conditions:
>
> - a kernel space task;
>
> 'khelper' running ____call_usermodehelper() in our case.
>
> - TIF_SIGPENDING is set.
>
> A signal has been delivered, say, as a result of kill(-1, SIGKILL).
>
> The endless loop is as follows:
>
> * syscall_exit_work:
>  - work_pending:            // start_of_the_loop

We shouldn't be here. This is the kernel thread.

And if start_thread() was already called, then

>  - work_notify_sig:
>    - do_notify_resume()
>      - do_signal()          ==> if (!user_mode(regs)) return; so signals are not handled

user_mode() is no longer true.

Once again, I can be wrong, I'll read this email tomorrow.

Oleg.


  reply	other threads:[~2012-03-07 18:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1144797072.59663.1331142646789.JavaMail.root@storentr1.softathome.com>
2012-03-07 17:51 ` 'khelper' (child) is stuck in endless loop: do_signal() and !user_mode(regs) Dmitry ADAMUSHKA (EXT)
2012-03-07 18:46   ` Oleg Nesterov [this message]
2012-03-07 20:05     ` Dmitry Adamushko
     [not found] <139779962.60750.1331202718116.JavaMail.root@storentr1.softathome.com>
2012-03-08 10:37 ` Dmitry ADAMUSHKA (EXT)
2012-03-08 15:46   ` Oleg Nesterov
     [not found] <CAO6Zf6C+SDZ-TV12wr9oiO6HB-itQ6fLPHFugXk0osEiAxW22w@mail.gmail.com>
2012-03-08 15:12 ` Dmitry ADAMUSHKA (EXT)
2012-03-08 15:55   ` Dmitry ADAMUSHKA (EXT)
2012-03-08 16:08     ` Oleg Nesterov
2012-03-08 16:29   ` Oleg Nesterov
2012-03-08 16:58     ` Dmitry ADAMUSHKA (EXT)
2012-03-12 16:35       ` Dmitry ADAMUSHKA (EXT)
2012-03-12 18:00         ` Oleg Nesterov

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=20120307184615.GA29005@redhat.com \
    --to=oleg@redhat.com \
    --cc=dmitry.adamushka_ext@softathome.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=ralf@linux-mips.org \
    --cc=wouter.cloetens@softathome.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.