]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Make copy_huge_page() always available
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 12 Jul 2021 15:32:07 +0000 (16:32 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 12 Jul 2021 18:30:56 +0000 (11:30 -0700)
commita48b475086a0eb35ad23861ae48fa3ab757b9065
tree44e6aba4c3735b180392437ef0d71f08a47337ee
parent3b08f2b34e419f4015c5081634e260ce9acfb77f
mm: Make copy_huge_page() always available

Rewrite copy_huge_page() and move it into mm/util.c so it's always
available.  Fixes an exposure of uninitialised memory on configurations
with HUGETLB and UFFD enabled and MIGRATION disabled.

Fixes: 42c135c8c354 ("mm, hugetlb: fix racy resv_huge_pages underflow on UFFDIO_COPY")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/migrate.h
include/linux/mm.h
mm/migrate.c
mm/util.c