Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1610163pxb; Sun, 17 Jan 2021 15:49:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJximWktrwS5OVqeSfFXoqcwzSqViITOxcgkSD+kKKwDoRH/1CzEDYmV3AuFXegBvNgLWyPY X-Received: by 2002:a17:906:ae4a:: with SMTP id lf10mr4839902ejb.480.1610927360934; Sun, 17 Jan 2021 15:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610927360; cv=none; d=google.com; s=arc-20160816; b=KkBNCKWhGJ8qEumDA1+tvQUFIC37SsjXfCyceZI2Cl+WR9CdLfnkS+j7sHOUuZNSe4 ypqtehk3qvDglHhWQCW0k7WEufTJVRF0qGYf0P6gMZ2aL82QBW+QlyHHuHgAsHfL9Ali Uvh6cAzUp8DmDkdm/EBO/8GBaOOA3TiQZocbdD5dt1PWcrtSVij549FDmHrrmweXkoqt E51FezdIvlvBsx+2xpS2yBDmvdTHPxIwRfN+dKjDLxa12i9oQXpx58UmXokbN2o5YCOZ rkGhNOzfJVb53F0V3ZqHlfREsJVH8PWe1hjf13+umBL+QAhYL5RsXTA01zWp4Wi5g/j+ Fn4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ulnCSQ44YUhN9X9MAQEMcAc8eh88jI5ZhULk5yuUjlY=; b=z93SOojKrQ03Zub6vsjIWlpfCdH44aIlDpLk6eHvZkFTEuK0f2NRHyHmB/El7J5FTn /XnaPAwasv7/3cc/9cPoguwS87PBthlRnCSTTlNiTeSnA+qJz1R42363UqDAe3U4LVr2 xcnHe4sSqwUR7DwKgszt4V83w9pLjOZiasLR49Z/xnYuKwhtjFjLjhREQJl6PqsSjg1A 6YWhmo3N0/ELk0E30xcSEgbSPmJf4YUuJnXm7zqd3Dxmy7qWidrDe9mMC9KMO2/I5uXf zt7/kNM6J7V8/cfE27Ct2g5xvNWhf3xY7MP+xh4fJ7kVrva1MQs72s5ZNRzb9lLcbROQ 0UIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=nH6qQH3C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs7si3728357ejc.147.2021.01.17.15.48.58; Sun, 17 Jan 2021 15:49:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=nH6qQH3C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbhAQWgd (ORCPT + 99 others); Sun, 17 Jan 2021 17:36:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbhAQWg1 (ORCPT ); Sun, 17 Jan 2021 17:36:27 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A1C8C061574 for ; Sun, 17 Jan 2021 14:35:47 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id g12so21094853ejf.8 for ; Sun, 17 Jan 2021 14:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ulnCSQ44YUhN9X9MAQEMcAc8eh88jI5ZhULk5yuUjlY=; b=nH6qQH3CSPydxTALD0skXPT4yCLrsSN7lTRp33mztLs5kVypDJKD4NNP92U3YRluSZ V+hoAv2K5mVRcBQ5S3eeqQDll9xwE7NEfJAmv4WqMBrWXiERvLx0mWx4l+AXB3Q/2dMg Zr7Hg6UBkpaPU34GaYIwFVG+jxpiO9LoUhfmMD5oKP6EkYO1wTjH/J6DDvTMJfMcO/f8 NnsawZSVh+dT1z7sADQMkyeF3waZCMRoP6LGK4ken2P/hV2gykYfNU9OdBI6XPXsB2tF QObiY285JpBicH0RDp2SUsdQ8Y584b9e1XuwY7V44Nfpdc7t8FZ+1MqczgTeDNmHQFwI sA7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ulnCSQ44YUhN9X9MAQEMcAc8eh88jI5ZhULk5yuUjlY=; b=HSxlj9EF8xK45nN4xqSRudRp3TFgMKRlaMdIv+tIAOHytk72Xmd7HrgUPjm8sX0zkB E5qeggDcPcJlAS7ziFtuKCM2Fxp16Gzc6fvQMsQdPVP0X8Q3telnXre5MHDH/rpLG4tw 5Swogv/q5YgEXA1aww9oKWMVevn1+Dv77AwaF0pWcf5NswtPP+ajmqpQTg/Fuw8tWX+t vsn5YCbftzoTWp7/XhOWCmHAwLbzQps4etiZaaTKDEw3lcnA4LMSnscSyFzyeOaZ9pZO b8C5tXRoTsPhR2fsQPCDG2OCNk84jBl9kNVLMA1aNah4etFvcVYnt1Pak8IjtHIJs3Md 2Lyw== X-Gm-Message-State: AOAM533fA3RLf1Gm+I1fS11H5NZWB3Y55uP/bjUf5+7uAJALAUvT+zKi TDc0ARgsPbDA5SYii5fC0osiNKPSG2lnIXjAiGEQew== X-Received: by 2002:a17:906:e085:: with SMTP id gh5mr951255ejb.418.1610922945887; Sun, 17 Jan 2021 14:35:45 -0800 (PST) MIME-Version: 1.0 References: <161058499000.1840162.702316708443239771.stgit@dwillia2-desk3.amr.corp.intel.com> <161058501210.1840162.8108917599181157327.stgit@dwillia2-desk3.amr.corp.intel.com> <20210117140142.ab91797266e0bef6b7dba9f9@linux-foundation.org> In-Reply-To: <20210117140142.ab91797266e0bef6b7dba9f9@linux-foundation.org> From: Dan Williams Date: Sun, 17 Jan 2021 14:35:36 -0800 Message-ID: Subject: Re: [PATCH v4 4/5] mm: Fix page reference leak in soft_offline_page() To: Andrew Morton Cc: Naoya Horiguchi , Michal Hocko , David Hildenbrand , Oscar Salvador , stable , Linux MM , linux-nvdimm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 17, 2021 at 2:01 PM Andrew Morton wrote: > > On Wed, 13 Jan 2021 16:43:32 -0800 Dan Williams wrote: > > > The conversion to move pfn_to_online_page() internal to > > soft_offline_page() missed that the get_user_pages() reference taken by > > the madvise() path needs to be dropped when pfn_to_online_page() fails. > > Note the direct sysfs-path to soft_offline_page() does not perform a > > get_user_pages() lookup. > > > > When soft_offline_page() is handed a pfn_valid() && > > !pfn_to_online_page() pfn the kernel hangs at dax-device shutdown due to > > a leaked reference. > > > > Fixes: feec24a6139d ("mm, soft-offline: convert parameter to pfn") > > Cc: Andrew Morton > > Cc: Naoya Horiguchi > > Cc: Michal Hocko > > Reviewed-by: David Hildenbrand > > Reviewed-by: Oscar Salvador > > Cc: > > Signed-off-by: Dan Williams > > A cc:stable patch in the middle is awkward. I'll make this a > standalone patch for merging into mainline soon (for 5.11) and shall > turn the rest into a 4-patch series, OK? Sounds good to me.