lkml.org 
[lkml]   [2019]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] staging: android: ion: Bail out upon SIGKILL when allocating memory.
Hello Tetsuo,

On Mon, 1 Jul 2019 at 17:07, Laura Abbott <labbott@redhat.com> wrote:
>
> On 7/1/19 6:55 AM, Tetsuo Handa wrote:
> > Andrew, can you pick up this patch? No response from Laura Abbott nor Sumit Semwal.
Apologies; it didn't seem to get flitered out for me. I'll re-check my
email filters.
> >
> > 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);
> >> }
> >>
> >>
> >
>
> Acked-by: Laura Abbott <labbott@redhat.com>
fwiw, Acked-by: Sumit Semwal <sumit.semwal@linaro.org>


--
Thanks and regards,

Sumit Semwal
Linaro Consumer Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs

\
 
 \ /
  Last update: 2019-07-01 16:03    [W:0.080 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site