]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm, hwpoison: fix page refcnt leaking in try_memory_failure_hugetlb()
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 18 Aug 2022 13:00:11 +0000 (21:00 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 22 Aug 2022 22:58:15 +0000 (15:58 -0700)
commitf975cd6b7bbaa934d199f5f2eb1ce8c25e2e61e3
treeadcf132a5b5df0d85ac4542cd97adb1ef2f955ca
parent3e2c9b2f5058789b39a4fabb7d725a7b30b1c96d
mm, hwpoison: fix page refcnt leaking in try_memory_failure_hugetlb()

Patch series "A few fixup patches for memory-failure".

This series contains a few fixup patches to fix incorrect update of page
refcnt, fix possible use-after-free issue and so on.  More details can be
found in the respective changelogs.

This patch (of 6):

When hwpoison_filter() refuses to hwpoison a hugetlb page, the refcnt of
the page would have been incremented if res == 1.  Using put_page() to fix
the refcnt leaking in this case.

Link: https://lkml.kernel.org/r/20220818130016.45313-1-linmiaohe@huawei.com
Link: https://lkml.kernel.org/r/20220818130016.45313-2-linmiaohe@huawei.com
Fixes: 405ce051236c ("mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb()")
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>
mm/memory-failure.c