From: Greg Kroah-Hartman Date: Sun, 9 Jul 2023 09:44:10 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.4.3~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b734cedc55c2e156e7682a7e21435d1f0210761e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch --- diff --git a/queue-5.15/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch b/queue-5.15/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch new file mode 100644 index 00000000000..53ed4652305 --- /dev/null +++ b/queue-5.15/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch @@ -0,0 +1,54 @@ +From 028725e73375a1ff080bbdf9fb503306d0116f28 Mon Sep 17 00:00:00 2001 +From: Liu Shixin +Date: Tue, 4 Jul 2023 18:19:42 +0800 +Subject: bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page + +From: Liu Shixin + +commit 028725e73375a1ff080bbdf9fb503306d0116f28 upstream. + +commit dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in +put_page_bootmem") fix an overlaps existing problem of kmemleak. But the +problem still existed when HAVE_BOOTMEM_INFO_NODE is disabled, because in +this case, free_bootmem_page() will call free_reserved_page() directly. + +Fix the problem by adding kmemleak_free_part() in free_bootmem_page() when +HAVE_BOOTMEM_INFO_NODE is disabled. + +Link: https://lkml.kernel.org/r/20230704101942.2819426-1-liushixin2@huawei.com +Fixes: f41f2ed43ca5 ("mm: hugetlb: free the vmemmap pages associated with each HugeTLB page") +Signed-off-by: Liu Shixin +Acked-by: Muchun Song +Cc: Matthew Wilcox +Cc: Mike Kravetz +Cc: Oscar Salvador +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/bootmem_info.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/linux/bootmem_info.h b/include/linux/bootmem_info.h +index cc35d010fa94..e1a3c9c9754c 100644 +--- a/include/linux/bootmem_info.h ++++ b/include/linux/bootmem_info.h +@@ -3,6 +3,7 @@ + #define __LINUX_BOOTMEM_INFO_H + + #include ++#include + + /* + * Types for free bootmem stored in page->lru.next. These have to be in +@@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsigned long info, struct page *page, + + static inline void free_bootmem_page(struct page *page) + { ++ kmemleak_free_part(page_to_virt(page), PAGE_SIZE); + free_reserved_page(page); + } + #endif +-- +2.41.0 + diff --git a/queue-5.15/series b/queue-5.15/series index c75930b6cec..18a899bb139 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -257,3 +257,4 @@ kbuild-disable-gcov-for-.mod.o.patch efi-libstub-disable-pci-dma-before-grabbing-the-efi-.patch ksmbd-avoid-field-overflow-warning.patch acpi-utils-fix-acpi_evaluate_dsm_typed-redefinition-.patch +bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch