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: <20190330131346.40289-1-smuchun@gmail.com>
Date:   Sat, 30 Mar 2019 21:13:46 +0800
From:   Muchun Song <smuchun@...il.com>
To:     catalin.marinas@....com, will.deacon@....com
Cc:     akpm@...ux-foundation.org, rppt@...ux.vnet.ibm.com,
        ard.biesheuvel@...aro.org, f.fainelli@...il.com,
        logang@...tatee.com, robin.murphy@....com, ghackmann@...roid.com,
        hannes@...xchg.org, stefan@...er.ch, david@...hat.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] arm64: mm: fix max_mapnr is assigned the wrong value

When we not use flat memory, the mem_map will be NULL and
pfn_to_page(max_pfn) is a pointer which is located in kernel space. So
max_mapnr is assigned a very large number(e.g., 0xffffxxxx_xxxxxxxx) - fix
it.

Signed-off-by: Muchun Song <smuchun@...il.com>
---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index bc02818fa48b..e86c21a44c88 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -535,7 +535,7 @@ void __init mem_init(void)
 	else
 		swiotlb_force = SWIOTLB_NO_FORCE;
 
-	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
+	set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);
 
 #ifndef CONFIG_SPARSEMEM_VMEMMAP
 	free_unused_memmap();
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ