summaryrefslogtreecommitdiffstats
path: root/mm/ksm.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-02-11 00:34:48 +0100
committerAndrew Morton <akpm@linux-foundation.org>2023-02-11 00:34:48 +0100
commitf67d6b26649379f8520abe6a6c7ed335310bf01e (patch)
treec161fce6517753dcacdcea21804f6e2c90164a33 /mm/ksm.c
parentmm/memremap.c: fix outdated comment in devm_memremap_pages (diff)
parentof: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem (diff)
downloadlinux-f67d6b26649379f8520abe6a6c7ed335310bf01e.tar.xz
linux-f67d6b26649379f8520abe6a6c7ed335310bf01e.zip
Merge branch 'mm-hotfixes-stable' into mm-stable
To pick up depended-upon changes
Diffstat (limited to 'mm/ksm.c')
-rw-r--r--mm/ksm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index cea0c4478220..ad591b779d53 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2628,8 +2628,11 @@ struct page *ksm_might_need_to_copy(struct page *page,
new_page = NULL;
}
if (new_page) {
- copy_user_highpage(new_page, page, address, vma);
-
+ if (copy_mc_user_highpage(new_page, page, address, vma)) {
+ put_page(new_page);
+ memory_failure_queue(page_to_pfn(page), 0);
+ return ERR_PTR(-EHWPOISON);
+ }
SetPageDirty(new_page);
__SetPageUptodate(new_page);
__SetPageLocked(new_page);