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: <1678081915-12599-1-git-send-email-js07.lee@samsung.com>
Date:   Mon,  6 Mar 2023 14:51:54 +0900
From:   Jungseung Lee <js07.lee@...sung.com>
To:     rmk+kernel@...linux.org.uk, linus.walleij@...aro.org,
        amit.kachhap@....com, ardb@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        keescook@...omium.org, js07.lee@...sung.com, js07.lee@...il.com
Subject: [PATCH 1/2] arm/mm : omit [_text, _stext) from kernel code region

The resource reservations in /proc/iomem made for the kernel code did
not reflect the gaps between pagetable and text.

In particular, if the CONFIG_STRICT_KERNEL_RWX option is turned on,
the wrong area is shown as the kernel code area.

Fix it by removing [_text, _stext) from kernel code region.

Before:
04000000-2f7fffff : System RAM
  04008000-04cfffff : Kernel code
  04e00000-05369a27 : Kernel data

After :
04000000-2f7fffff : System RAM
  04100000-04cfffff : Kernel code
  04e00000-05369a27 : Kernel data

Signed-off-by: Jungseung Lee <js07.lee@...sung.com>
---
 arch/arm/kernel/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 75cd469..3059860 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -865,7 +865,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
 	struct resource *res;
 	u64 i;
 
-	kernel_code.start   = virt_to_phys(_text);
+	kernel_code.start   = virt_to_phys(_stext);
 	kernel_code.end     = virt_to_phys(__init_begin - 1);
 	kernel_data.start   = virt_to_phys(_sdata);
 	kernel_data.end     = virt_to_phys(_end - 1);
@@ -1139,7 +1139,7 @@ void __init setup_arch(char **cmdline_p)
 	if (mdesc->reboot_mode != REBOOT_HARD)
 		reboot_mode = mdesc->reboot_mode;
 
-	setup_initial_init_mm(_text, _etext, _edata, _end);
+	setup_initial_init_mm(_stext, _etext, _edata, _end);
 
 	/* populate cmd_line too for later use, preserving boot_command_line */
 	strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ