public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Eric Biederman <ebiederm@xmission.com>,
	syzbot <syzbot+8ab2d0f39fb79fe6ca40@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] kexec: Bail out upon SIGKILL when allocating memory.
Date: Tue, 23 Jul 2019 19:54:22 -0700	[thread overview]
Message-ID: <20190724025422.GQ643@sol.localdomain> (raw)
In-Reply-To: <993c9185-d324-2640-d061-bed2dd18b1f7@I-love.SAKURA.ne.jp>

On Fri, Jun 14, 2019 at 07:16:18PM +0900, Tetsuo Handa wrote:
> syzbot found that a thread can stall for minutes inside kexec_load() after
> that thread was killed by SIGKILL [1]. It turned out that the reproducer
> was trying to allocate 2408MB of memory using kimage_alloc_page() from
> kimage_load_normal_segment(). Let's check for SIGKILL before doing memory
> allocation.
> 
> [1] https://syzkaller.appspot.com/bug?id=a0e3436829698d5824231251fad9d8e998f94f5e
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Reported-by: syzbot <syzbot+8ab2d0f39fb79fe6ca40@syzkaller.appspotmail.com>
> ---
>  kernel/kexec_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index fd5c95f..2b25d95 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -302,6 +302,8 @@ static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order)
>  {
>  	struct page *pages;
>  
> +	if (fatal_signal_pending(current))
> +		return NULL;
>  	pages = alloc_pages(gfp_mask & ~__GFP_ZERO, order);
>  	if (pages) {
>  		unsigned int count, i;
> -- 
> 1.8.3.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/993c9185-d324-2640-d061-bed2dd18b1f7%40I-love.SAKURA.ne.jp.
> For more options, visit https://groups.google.com/d/optout.

What happened to this patch?  This bug is still occurring.

- Eric

  parent reply	other threads:[~2019-07-24  2:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 20:53 INFO: task syz-executor can't die for more than 143 seconds syzbot
2019-06-13  2:53 ` syzbot
2019-06-14 10:16   ` [PATCH] kexec: Bail out upon SIGKILL when allocating memory Tetsuo Handa
2019-07-01 10:52     ` Tetsuo Handa
2019-07-24  2:54     ` Eric Biggers [this message]
2019-07-24  3:09       ` Tetsuo Handa
2019-06-21  9:58 ` INFO: task syz-executor can't die for more than 143 seconds Tetsuo Handa
2019-07-01 10:55   ` [PATCH] staging: android: ion: Bail out upon SIGKILL when allocating memory Tetsuo Handa
2019-07-01 11:36     ` Laura Abbott
2019-07-01 14:02       ` Sumit Semwal
2019-07-01 21:02         ` Tetsuo Handa
2019-07-01 21:21           ` Laura Abbott

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=20190724025422.GQ643@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=syzbot+8ab2d0f39fb79fe6ca40@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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