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: <FD7D773099A0C7EC+20240903130606.292935-2-zig@iorw.io>
Date: Tue,  3 Sep 2024 21:06:05 +0800
From: Zigit Zo <zig@...w.io>
To: ojeda@...nel.org,
	bjorn3_gh@...tonmail.com,
	richard@....at,
	anton.ivanov@...bridgegreys.com,
	johannes@...solutions.net,
	tglx@...utronix.de,
	mingo@...hat.com,
	nathan@...nel.org,
	ndesaulniers@...gle.com,
	gary@...yguo.net
Cc: zig@...w.io,
	rust-for-linux@...r.kernel.org,
	linux-um@...ts.infradead.org,
	llvm@...ts.linux.dev,
	x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] rust: arch/um: use 'static' relocation model for uml modules

In the x86_64 UML, kernel modules compiled with Rust will currently
generate some R_X86_64_GOTPCREL relocations, which will then be rejected
by the kernel.

And because of the kernel modules of UML are only got handled by the UML
itself, relocation model 'static' can work as expected other than 'pie'.
---
 arch/um/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/Makefile b/arch/um/Makefile
index 00b63bac5eff..b04b1d4d6dfe 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -63,7 +63,7 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
 	-Din6addr_loopback=kernel_in6addr_loopback \
 	-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
 
-KBUILD_RUSTFLAGS += -Crelocation-model=pie
+KBUILD_RUSTFLAGS_KERNEL += -Crelocation-model=pie
 
 KBUILD_AFLAGS += $(ARCH_INCLUDE)
 
-- 
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ