From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbdITG21 (ORCPT ); Wed, 20 Sep 2017 02:28:27 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36074 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751596AbdITG20 (ORCPT ); Wed, 20 Sep 2017 02:28:26 -0400 X-Google-Smtp-Source: AOwi7QAtyhQEYmsuTCOxhXTVlssJGQPgGzOcWaq5jIjShfg/DgFf2pa/qQywxsAu1nIZh2lozScv7w== Date: Wed, 20 Sep 2017 15:28:21 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, kernel-team , Sergey Senozhatsky Subject: Re: [PATCH] zram: fix null dereference of handle Message-ID: <20170920062821.GC6298@jagdpanzerIV.localdomain> References: <20170919102125.GB401@jagdpanzerIV.localdomain> <20170920055125.GB9428@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170920055125.GB9428@bbox> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On (09/20/17 14:51), Minchan Kim wrote: > 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. thanks! yep, I guess we are also potentially looking at __zs_map_object() preempting zsmalloc in normal context, which would overwrite area->vm_addr from IRQ, map it, use it, unmap it in __zs_unmap_object(). and then resumed normal context will attempt to use unmapped area->vm_addr, I suppose. > Do you mind sending a formal patch? sure, will do. -ss