linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] mm/hwpoison: fix potential pte_unmap_unlock pte error
Date: Tue, 17 Aug 2021 07:29:00 +0000	[thread overview]
Message-ID: <20210817072900.GA452155@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <20210814105131.48814-3-linmiaohe@huawei.com>

On Sat, Aug 14, 2021 at 06:51:29PM +0800, Miaohe Lin wrote:
> If the first pte is equal to poisoned_pfn, i.e. check_hwpoisoned_entry()
> return 1, the wrong ptep - 1 would be passed to pte_unmap_unlock().
> 
> Fixes: ad9c59c24095 ("mm,hwpoison: send SIGBUS with error virutal address")
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

I agree with the change itself, so

Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>

One question is that according to "grep -r pte_unmap_unlock ." command over
whole kernel source code, pte_unmap_unlock() is called with "ptep - 1" in some places.
I think that none of them seems to have "break in for loop" in locked period,
so the same problem does not occur there.  But I'm still not sure why some place
call with "ptep - 1" and the others call with pte returned by pte_offset_map_lock().

  reply	other threads:[~2021-08-17  7:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14 10:51 [PATCH 0/4] Cleanups and fixup for memcontrol Miaohe Lin
2021-08-14 10:51 ` [PATCH 1/4] mm/hwpoison: remove unneeded variable unmap_success Miaohe Lin
2021-08-17  7:28   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 10:51 ` [PATCH 2/4] mm/hwpoison: fix potential pte_unmap_unlock pte error Miaohe Lin
2021-08-17  7:29   ` HORIGUCHI NAOYA(堀口 直也) [this message]
2021-08-17  8:24     ` Miaohe Lin
2021-08-17 23:37       ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 10:51 ` [PATCH 3/4] mm/hwpoison: change argument struct page **hpagep to *hpage Miaohe Lin
2021-08-17  7:28   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 10:51 ` [PATCH 4/4] mm/hwpoison: fix some obsolete comments Miaohe Lin
2021-08-17  7:28   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 11:00 ` [PATCH 0/4] Cleanups and fixup for memcontrol Miaohe Lin

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=20210817072900.GA452155@hori.linux.bs1.fc.nec.co.jp \
    --to=naoya.horiguchi@nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).