lkml.org 
[lkml]   [2017]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zram: fix null dereference of handle
On Tue, Sep 19, 2017 at 07:21:25PM +0900, Sergey Senozhatsky wrote:
> Minchan,
>
> I just ran across it [because I had a bug to analize where this
> part was involved]. I'd really prefer the kernel to BUG_ON immediately
> instead of dying in agony.
>
> can we, please, return BUG_ON() back?
>
> there is no point in trying to save the kernel once it did that type
> of violation.

I agree. If it happens, it would corrupt other user's buffer which ends
up leaking some private data from others so there is pointless to keep
system alive to debug it.

Do you mind sending a formal patch?
Thanks!

>
> ---
>
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index 7c38e850a8fc..685049a9048d 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -1349,7 +1349,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle,
> * pools/users, we can't allow mapping in interrupt context
> * because it can corrupt another users mappings.
> */
> - WARN_ON_ONCE(in_interrupt());
> + BUG_ON(in_interrupt());
>
> /* From now on, migration cannot move the object */
> pin_tag(handle);
>

\
 
 \ /
  Last update: 2017-09-20 07:52    [W:0.042 / U:2.656 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site