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: <20210928105057.3406-1-peng.fan@oss.nxp.com>
Date:   Tue, 28 Sep 2021 18:50:57 +0800
From:   "Peng Fan (OSS)" <peng.fan@....nxp.com>
To:     rppt@...nel.org, akpm@...ux-foundation.org, david@...hat.com,
        geert+renesas@...der.be
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Peng Fan <peng.fan@....com>
Subject: [PATCH] memblock: check memory total_size

From: Peng Fan <peng.fan@....com>

mem=[X][G|M] is broken on NXP i.MX ARM64 platform, there is cases that
even type.cnt is 1, but total_size is not 0 because regions are merged
into 1. So only check 'cnt' is not enough, total_size also needs to be
taked into consideration, othersize bootargs 'mem=[X][G|B]' not work
anymore.

Fixes: e888fa7bb882 ("memblock: Check memory add/cap ordering")
Cc: Mike Rapoport <rppt@...nel.org>
Cc: Geert Uytterhoeven <geert+renesas@...der.be>
Cc: David Hildenbrand <david@...hat.com>
Signed-off-by: Peng Fan <peng.fan@....com>
---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 184dcd2e5d99..ab67b82a9cce 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1687,7 +1687,7 @@ void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
 	if (!size)
 		return;
 
-	if (memblock.memory.cnt <= 1) {
+	if (memblock_memory->cnt <= 1 && !memblock_memory->total_size) {
 		pr_warn("%s: No memory registered yet\n", __func__);
 		return;
 	}
-- 
2.30.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ