[PATCH openEuler-1.0-LTS] mm/vmscan: fix hwpoisoned THP handling in shrink_page_list

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICDSA3 CVE: NA ---------------------------------------- In shrink_page_list(), the hwpoisoned page may be THP, which can't be handled by try_to_unmap(), lead to null-ptr-deref in try_to_unmap_one(). To fix it, skip the hwpoisoned page if it is THP. Fixes: 21b0040ede03 ("mm/vmscan: don't try to reclaim hwpoison folio") Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com> --- mm/vmscan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index df7998e8174f..6a649f02666f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1170,6 +1170,9 @@ static unsigned long shrink_page_list(struct list_head *page_list, goto keep; if (PageHWPoison(page)) { + if (PageTransHuge(page)) + goto keep_locked; + try_to_unmap(page, TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS); unlock_page(page); put_page(page); -- 2.43.0

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/16650 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/KXH... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/16650 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/KXH...
participants (2)
-
Jinjiang Tu
-
patchwork bot