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]
Date:	Sat, 28 Mar 2015 23:36:02 -0400
From:	Zhihui Zhang <zzhsuny@...il.com>
To:	akpm@...ux-foundation.org, mgorman@...e.de
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] Do not use arbitrary large movablecore to calculate kernelcore

If kernelcore is not set, then we are working with a very large kernelcore
for nothing - no movable zone will be created. If kernelcore is set,
then it is not respected at all.

Signed-off-by: Zhihui Zhang <zzhsuny@...il.com>
---
 mm/page_alloc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 40e2942..32bf5da 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5199,7 +5199,11 @@ static void __init find_zone_movable_pfns_for_nodes(void)
 		 */
 		required_movablecore =
 			roundup(required_movablecore, MAX_ORDER_NR_PAGES);
-		corepages = totalpages - required_movablecore;
+
+		if (totalpages > required_movablecore)
+			corepages = totalpages - required_movablecore;
+		else
+			corepages = 0;
 
 		required_kernelcore = max(required_kernelcore, corepages);
 	}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ