From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AA4CC433E0 for ; Thu, 28 Jan 2021 20:51:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72D2764DE5 for ; Thu, 28 Jan 2021 20:51:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72D2764DE5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B148F6B0005; Thu, 28 Jan 2021 15:51:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AC58D6B0006; Thu, 28 Jan 2021 15:51:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B3C46B006C; Thu, 28 Jan 2021 15:51:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 855CF6B0005 for ; Thu, 28 Jan 2021 15:51:33 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 43E861EFF for ; Thu, 28 Jan 2021 20:51:33 +0000 (UTC) X-FDA: 77756379666.13.cord56_371223d275a2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id C699418140B67 for ; Thu, 28 Jan 2021 20:51:31 +0000 (UTC) X-HE-Tag: cord56_371223d275a2 X-Filterd-Recvd-Size: 2779 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 20:51:31 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9702264DE0; Thu, 28 Jan 2021 20:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1611867090; bh=xphOtEftTu7lP4Gys6R2t4vfQ/b/ea8bPkcZ8sh133c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KlgaJcRLccaM7VL4bcABB0YaqCKnbY+UbV6gSJA9KmbWUFjH+gCAJU6O6GQ8IxJfT Zz9iSrJVr+vVASFSL6F+L5CuZR0UsIKNZLc/M4lk6rzdGMnKAxLgeKJyO58nxx12Zf 41FdYmQu5hBDGWph414x+bE9JsmYSwL3lX+YLHAI= Date: Thu, 28 Jan 2021 12:51:29 -0800 From: Andrew Morton To: Vlastimil Babka Cc: Colin King , Seth Jennings , Dan Streetman , Vitaly Wool , Tian Tao , Stephen Rothwell , linux-mm@kvack.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] mm/zswap: fix potential uninitialized pointer read on tmp Message-Id: <20210128125129.27dd2042b8d04b28c45ad7c0@linux-foundation.org> In-Reply-To: <2dee1f77-863b-e7aa-a3d2-bb4591d4f720@suse.cz> References: <20210128141728.639030-1-colin.king@canonical.com> <2dee1f77-863b-e7aa-a3d2-bb4591d4f720@suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 28 Jan 2021 16:18:23 +0100 Vlastimil Babka wrote: > On 1/28/21 3:17 PM, Colin King wrote: > > From: Colin Ian King > > > > In the case where zpool_can_sleep_mapped(pool) returns 0 > > then tmp is not allocated and tmp is then an uninitialized > > pointer. Later if entry is null, tmp is freed, hence free'ing > > an uninitialized pointer. Fix this by ensuring tmp is initialized > > to NULL. > > > > Addresses-Coverity: ("Uninitialized pointer read") > > Fixes: 908aa806dba0 ("mm/zswap: fix potential memory leak") > > That's a linux-next hash, patch is in mmotm [1] *) You know what it means... > > *) actually it's not there, yet it is in -next. What's going on? > > [1] > https://ozlabs.org/~akpm/mmotm/broken-out/mm-zswap-fix-potential-memory-leak.patch The containing file was renamed to https://ozlabs.org/~akpm/mmotm/broken-out/mm-zswap-add-the-flag-can_sleep_mapped-fix-2.patch, since it's a fix against mm-zswap-add-the-flag-can_sleep_mapped.patch. And this patch's containing file will of course be mm-zswap-add-the-flag-can_sleep_mapped-fix-3.patch.