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  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,  2 Jan 2021 22:11:56 +0200
From:   Ariel Marcovitch <>
Subject: [PATCH v2] powerpc: fix alignment bug whithin the init sections

This is a bug that causes early crashes in builds with a
.exit.text section smaller than a page and a .init.text section that
ends in the beginning of a physical page (this is kinda random, which
might explain why this wasn't really encountered before).

The init sections are ordered like this:

Currently, these sections aren't page aligned.

Because the init code might become read-only at runtime and because the
.init.text section can potentially reside on the same physical page as, the beginning of might be mapped read-only along
with .init.text.

Then when the kernel tries to modify a variable in (like
kthreadd_done, used in kernel_init()) the kernel panics.

To avoid this, make _einittext page aligned and also align .exit.text
to make sure is always seperated from the text segments.

Fixes: 060ef9d89d18 ("powerpc32: PAGE_EXEC required for inittext")
Signed-off-by: Ariel Marcovitch <>
 arch/powerpc/kernel/ | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/kernel/ b/arch/powerpc/kernel/
index 6db90cdf11da..b6c765d8e7ee 100644
--- a/arch/powerpc/kernel/
+++ b/arch/powerpc/kernel/
@@ -187,6 +187,11 @@ SECTIONS
 	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
 		_sinittext = .;
+		/* .init.text might be RO so we must
+		* ensure this section ends in a page boundary.
+		*/
 		_einittext = .;
 #ifdef CONFIG_PPC64
@@ -200,6 +205,8 @@ SECTIONS

base-commit: 2c85ebc57b3e1817b6ce1a6b703928e113a90442

Powered by blists - more mailing lists