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>] [day] [month] [year] [list]
Message-ID: <20230802183614.15520-1-ppbuk5246@gmail.com>
Date:   Wed,  2 Aug 2023 19:36:14 +0100
From:   Levi Yun <ppbuk5246@...il.com>
To:     rppt@...nel.org, akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Levi Yun <ppbuk5246@...il.com>
Subject: [PATCH] mm/mm_init: Ignore kernelcore=mirror boot option when no mirror memory presents.

In the machine where no mirror memory is set,
All memory region in ZONE_NORMAL is used as ZONE_MOVABLE
when kernelcore=mirror boot option is used.
So, ZONE_NORMAL couldn't be populated properly
because all of ZONE_NORMAL pages is absent.

To avoid this abnormal situation,
ignore disable kernelcore=mirror option when no mirror memory is found.

Signed-off-by: Levi Yun <ppbuk5246@...il.com>
---
 mm/mm_init.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index a1963c3322af..4c180ef1a993 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -376,10 +376,13 @@ static void __init find_zone_movable_pfns_for_nodes(void)
 	 */
 	if (mirrored_kernelcore) {
 		bool mem_below_4gb_not_mirrored = false;
+		bool no_mirror_mem = true;
 
 		for_each_mem_region(r) {
-			if (memblock_is_mirror(r))
+			if (memblock_is_mirror(r)) {
+				no_mirror_mem = false;
 				continue;
+			}
 
 			nid = memblock_get_region_node(r);
 
@@ -398,6 +401,12 @@ static void __init find_zone_movable_pfns_for_nodes(void)
 		if (mem_below_4gb_not_mirrored)
 			pr_warn("This configuration results in unmirrored kernel memory.\n");
 
+		if (no_mirror_mem) {
+			pr_warn("There is no mirrored memory. Ignore kernelcore=mirror.\n");
+			mirrored_kernelcore = false;
+			memset(zone_movable_pfn, 0x00, sizeof(zone_movable_pfn));
+		}
+
 		goto out2;
 	}
 
-- 
2.37.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ