From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Liu Shixin <liushixin2@huawei.com>,
Muchun Song <songmuchun@bytedance.com>,
Matthew Wilcox <willy@infradead.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 6.4 6/8] bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
Date: Sun, 9 Jul 2023 13:14:12 +0200 [thread overview]
Message-ID: <20230709111345.488184873@linuxfoundation.org> (raw)
In-Reply-To: <20230709111345.297026264@linuxfoundation.org>
From: Liu Shixin <liushixin2@huawei.com>
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 <liushixin2@huawei.com>
Acked-by: Muchun Song <songmuchun@bytedance.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/bootmem_info.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/linux/bootmem_info.h
+++ b/include/linux/bootmem_info.h
@@ -3,6 +3,7 @@
#define __LINUX_BOOTMEM_INFO_H
#include <linux/mm.h>
+#include <linux/kmemleak.h>
/*
* Types for free bootmem stored in page->lru.next. These have to be in
@@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsi
static inline void free_bootmem_page(struct page *page)
{
+ kmemleak_free_part(page_to_virt(page), PAGE_SIZE);
free_reserved_page(page);
}
#endif
next prev parent reply other threads:[~2023-07-09 11:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-09 11:14 [PATCH 6.4 0/8] 6.4.3-rc1 review Greg Kroah-Hartman
2023-07-09 11:14 ` [PATCH 6.4 1/8] mm: disable CONFIG_PER_VMA_LOCK until its fixed Greg Kroah-Hartman
2023-07-09 11:14 ` [PATCH 6.4 2/8] mm: lock a vma before stack expansion Greg Kroah-Hartman
2023-07-09 11:14 ` [PATCH 6.4 3/8] mm: lock newly mapped VMA which can be modified after it becomes visible Greg Kroah-Hartman
2023-07-09 11:14 ` [PATCH 6.4 4/8] mm: lock newly mapped VMA with corrected ordering Greg Kroah-Hartman
2023-07-09 11:14 ` [PATCH 6.4 5/8] mm: call arch_swap_restore() from do_swap_page() Greg Kroah-Hartman
2023-07-09 11:14 ` Greg Kroah-Hartman [this message]
2023-07-09 11:14 ` [PATCH 6.4 7/8] fork: lock VMAs of the parent process when forking Greg Kroah-Hartman
2023-07-09 12:39 ` Thorsten Leemhuis
2023-07-09 13:32 ` Greg Kroah-Hartman
2023-07-09 16:04 ` Suren Baghdasaryan
2023-07-09 16:09 ` Greg Kroah-Hartman
2023-07-09 19:53 ` Suren Baghdasaryan
2023-07-09 20:24 ` Suren Baghdasaryan
2023-07-09 20:40 ` Greg Kroah-Hartman
2023-07-09 11:14 ` [PATCH 6.4 8/8] fork: lock VMAs of the parent process when forking, again Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230709111345.488184873@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=liushixin2@huawei.com \
--cc=mike.kravetz@oracle.com \
--cc=osalvador@suse.de \
--cc=patches@lists.linux.dev \
--cc=songmuchun@bytedance.com \
--cc=stable@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox