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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250311112112.GEZ9AcqM2ceIQVUA0N@fat_crate.local>
Date: Tue, 11 Mar 2025 12:21:12 +0100
From: Borislav Petkov <bp@...en8.de>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Brian Gerst <brgerst@...il.com>, Oleg Nesterov <oleg@...hat.com>,
	linux-kernel@...r.kernel.org, x86@...nel.org,
	Ingo Molnar <mingo@...nel.org>, "H . Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Uros Bizjak <ubizjak@...il.com>, stable@...r.kernel.org,
	Fangrui Song <i@...kray.me>, Nathan Chancellor <nathan@...nel.org>,
	Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH] x86/stackprotector: fix build failure with
 CONFIG_STACKPROTECTOR=n

On Tue, Mar 11, 2025 at 11:37:59AM +0100, Ard Biesheuvel wrote:
> There are many occurrences of
> 
> ffffffff8373cb87: 49 c7 c6 20 c0 55 86 mov    $0xffffffff8655c020,%r14
> ffffffff8373cb8a:         R_X86_64_32S __ref_stack_chk_guard
> 
> whereas the ordinary Clang uses R_X86_64_REX_GOTPCRELX here, which are
> relaxed by the linker.
> 
> I suspect that Ubuntu's Clang 15 has some additional patches that
> trigger this behavior.

... and then we don't know what else out there does other "additional" patches

;-\
 
> We could add __no_stack_protector to __head to work around this.

Yap, that fixes the build:

diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h
index 0e82ebc5d1e1..6cf4ea847dc3 100644
--- a/arch/x86/include/asm/init.h
+++ b/arch/x86/include/asm/init.h
@@ -2,7 +2,7 @@
 #ifndef _ASM_X86_INIT_H
 #define _ASM_X86_INIT_H
 
-#define __head __section(".head.text") __no_sanitize_undefined
+#define __head __section(".head.text") __no_sanitize_undefined __no_stack_protector
 
 struct x86_mapping_info {
        void *(*alloc_pgt_page)(void *); /* allocate buf for page table */

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ