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: <20210127041727.11001-1-sw0312.kim@samsung.com>
Date:   Wed, 27 Jan 2021 13:17:26 +0900
From:   Seung-Woo Kim <sw0312.kim@...sung.com>
To:     linux@...linux.org.uk, linux-arm-kernel@...ts.infradead.org
Cc:     linux-kernel@...r.kernel.org, rppt@...nel.org,
        akpm@...ux-foundation.org, ardb@...nel.org, jcmvbkbc@...il.com,
        olof@...om.net, sw0312.kim@...sung.com, jh80.chung@...sung.com
Subject: [RESEND][PATCH] ARM: mm: Free memblock from free_initrd_mem()

Even after free_initrd_mem(), memblock for initrd remains. Free
memblock for initrd from free_initrd_mem() line generic function.

Reported-by: Jaehoon Chung <jh80.chung@...sung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@...sung.com>
---
 arch/arm/mm/init.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 828a256..f7db023 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -530,6 +530,13 @@ void free_initmem(void)
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
+#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
+	unsigned long aligned_start = ALIGN_DOWN(start, PAGE_SIZE);
+	unsigned long aligned_end = ALIGN(end, PAGE_SIZE);
+
+	memblock_free(__pa(aligned_start), aligned_end - aligned_start);
+#endif
+
 	if (start == initrd_start)
 		start = round_down(start, PAGE_SIZE);
 	if (end == initrd_end)
-- 
1.7.4.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ