mm/hwpoison: fix potential pte_unmap_unlock pte error
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 2 Sep 2021 21:58:22 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Sep 2021 16:58:15 +0000 (09:58 -0700)
commitea3732f7a1cf636284388988d1a1e56d5cba6044
treeb10edd0c45d46b87164a0804425a4da66e46ed5c
parentae611d072c5c2968e2cc29431cf58094d8971b94
mm/hwpoison: fix potential pte_unmap_unlock pte error

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().

Link: https://lkml.kernel.org/r/20210814105131.48814-3-linmiaohe@huawei.com
Fixes: ad9c59c24095 ("mm,hwpoison: send SIGBUS with error virutal address")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory-failure.c