From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbdITG3l (ORCPT ); Wed, 20 Sep 2017 02:29:41 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37407 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbdITG3j (ORCPT ); Wed, 20 Sep 2017 02:29:39 -0400 X-Google-Smtp-Source: AOwi7QAXZ8l79jI9aUoPkm2exE+Cyuz9r2QPFD8SSTbRAJc8Yuv/sC/x2chUavG1WxbSUDths1KA0g== Date: Wed, 20 Sep 2017 15:29:34 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, kernel-team , Sergey Senozhatsky Subject: Re: [PATCH v2] zram: fix null dereference of handle Message-ID: <20170920062934.GD6298@jagdpanzerIV.localdomain> References: <1505887347-10881-1-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505887347-10881-1-git-send-email-minchan@kernel.org> 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 On (09/20/17 15:02), Minchan Kim wrote: > For the testing, I found handle passed to zs_map_object in __zram_bvec_read > is NULL so that kernel goes the Oops by pin_object. > > The reason is there is no routine to check the slot's freeing > after getting the slot's lock. This patch fixes it. > > * From v1: > * remove unlikely branch - Sergey > * In !handle case, use 0 instead of zram_get_element - Sergey > > Fixes: 1f7319c74275 ("zram: partial IO refactoring") > Cc: Sergey Senozhatsky > Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky -ss