LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Laura Abbott <labbott@redhat.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] staging: android: ion: Bail out upon SIGKILL when allocating memory.
Date: Mon, 1 Jul 2019 19:55:19 +0900
Message-ID: <d088f188-5f32-d8fc-b9a0-0b404f7501cc@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <03763360-a7de-de87-eb90-ba7838143930@I-love.SAKURA.ne.jp>

Andrew, can you pick up this patch? No response from Laura Abbott nor Sumit Semwal.

On 2019/06/21 18:58, Tetsuo Handa wrote:
> From e0758655727044753399fb4f7c5f3eb25ac5cccd Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Date: Fri, 21 Jun 2019 11:22:51 +0900
> Subject: [PATCH] staging: android: ion: Bail out upon SIGKILL when allocating memory.
> 
> syzbot found that a thread can stall for minutes inside
> ion_system_heap_allocate() after that thread was killed by SIGKILL [1].
> 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>
> ---
>  drivers/staging/android/ion/ion_page_pool.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c
> index fd4995fb676e..f85ec5b16b65 100644
> --- a/drivers/staging/android/ion/ion_page_pool.c
> +++ b/drivers/staging/android/ion/ion_page_pool.c
> @@ -8,11 +8,14 @@
>  #include <linux/list.h>
>  #include <linux/slab.h>
>  #include <linux/swap.h>
> +#include <linux/sched/signal.h>
>  
>  #include "ion.h"
>  
>  static inline struct page *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
>  {
> +	if (fatal_signal_pending(current))
> +		return NULL;
>  	return alloc_pages(pool->gfp_mask, pool->order);
>  }
>  
> 


  reply index

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
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   ` Tetsuo Handa [this message]
2019-07-01 11:36     ` [PATCH] staging: android: ion: Bail out upon SIGKILL when allocating memory 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 publically 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=d088f188-5f32-d8fc-b9a0-0b404f7501cc@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sumit.semwal@linaro.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git