mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: <akpm@linux-foundation.org>, <naoya.horiguchi@nec.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: memory-failure: fix potential page refcnt leak in memory_failure()
Date: Mon, 3 Jul 2023 19:27:25 +0800	[thread overview]
Message-ID: <1e8ff9bf-c81b-9c39-9f44-2f82efcd36ec@huawei.com> (raw)
In-Reply-To: <20230703063713.GA3012709@ik1-406-35019.vs.sakura.ne.jp>

On 2023/7/3 14:37, Naoya Horiguchi wrote:
> On Sat, Jul 01, 2023 at 03:28:37PM +0800, Miaohe Lin wrote:
>> put_ref_page() is not called to drop extra refcnt when comes from madvise
>> in the case pfn is valid but pgmap is NULL leading to page refcnt leak.
> 
> Is this test scenario realistic one?  I don't think that we can call madvise() for
> such a device memory page.  If this is the case, this issue can be thought as
> potentioal one (so no need to send to stable). 

This is a theoretical problem. If pagemap can ever be NULL after page refcnt is increased, this
would occur. I think it's not needed to send to stable too.

> 
>>
>> Fixes: 1e8aaedb182d ("mm,memory_failure: always pin the page in madvise_inject_error")
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> 
> Anyway, the patch looks good to me. Thanks you.
> 
> Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>

Thanks for your review and comment.


      reply	other threads:[~2023-07-03 11:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  7:28 Miaohe Lin
2023-07-03  6:37 ` Naoya Horiguchi
2023-07-03 11:27   ` Miaohe Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e8ff9bf-c81b-9c39-9f44-2f82efcd36ec@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@linux.dev \
    --cc=naoya.horiguchi@nec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®