lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240527044523.29207-1-osalvador@suse.de>
Date: Mon, 27 May 2024 06:45:23 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	David Hildenbrand <david@...hat.com>,
	Dave Hansen <dave.hansen@...el.com>,
	Oscar Salvador <osalvador@...e.de>
Subject: [PATCH] arch/x86: Do not explicitly clear Reserved flag in free_pagetable

In free_pagetable() we use the non-atomic version for clearing the
PageReserved bit from the page.
free_pagetable() will either call free_reserved_page() or
put_page_bootmem(), which will eventually end up calling
free_serverd_page(), and in there we already clear the PageReserved flag.

Signed-off-by: Oscar Salvador <osalvador@...e.de>
---
This has been like this since commit ae9aae9eda2d ("memory-hotplug: common APIs to
support page tables hot-remove"), so I might be missing something obvious, but
I cannot explain why we would need that __ClearPageReserved upfront, when
free_reserved_pages() already does that for us.
---
 arch/x86/mm/init_64.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 7e177856ee4f..9f4778c2cf9f 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -980,8 +980,6 @@ static void __meminit free_pagetable(struct page *page, int order)
 
 	/* bootmem page has reserved flag */
 	if (PageReserved(page)) {
-		__ClearPageReserved(page);
-
 		magic = page->index;
 		if (magic == SECTION_INFO || magic == MIX_SECTION_INFO) {
 			while (nr_pages--)
-- 
2.45.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ