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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250218173827.vk4gplulq3pjdnn6@jpoimboe>
Date: Tue, 18 Feb 2025 09:38:27 -0800
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
	Huacai Chen <chenhuacai@...nel.org>,
	Ard Biesheuvel <ardb@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Tiezhu Yang <yangtiezhu@...ngson.cn>
Subject: Re: [PATCH] objtool: Use idiomatic section name for relocatable
 rodata under PIE

On Tue, Feb 18, 2025 at 10:25:39AM +0100, Ard Biesheuvel wrote:
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 91a7e824ed8b..337d3336e175 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -457,7 +457,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
>  	. = ALIGN((align));						\
>  	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
>  		__start_rodata = .;					\
> -		*(.rodata) *(.rodata.*) *(..rodata.*)			\
> +		*(.rodata) *(.rodata.*) *(.data.rel.ro*)		\

If I understand correctly, this is fixing an existing bug in loongarch
and any other arches using PIE, right?  And it has nothing to do with
objtool?

If so, it feels like this needs to be its own patch, described as a fix.

>  		SCHED_DATA						\
>  		RO_AFTER_INIT_DATA	/* Read only after init */	\
>  		. = ALIGN(8);						\
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index 3d013f1412e0..27024a128a6a 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -110,7 +110,11 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
>  /* Unreachable code */
>  #ifdef CONFIG_OBJTOOL
>  /* Annotate a C jump table to allow objtool to follow the code flow */
> -#define __annotate_jump_table __section("..rodata.c_jump_table")
> +#ifndef __pie__
> +#define __annotate_jump_table __section(".rodata.c_jump_table")
> +#else
> +#define __annotate_jump_table __section(".data.rel.ro.c_jump_table")
> +#endif

Why have two different section names, does .data.rel.ro.* not work for
non-PIE?

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ