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: <ZkPfwRj+QR2okyJv@ghost>
Date: Tue, 14 May 2024 15:03:45 -0700
From: Charlie Jenkins <charlie@...osinc.com>
To: Qingfang Deng <dqfext@...il.com>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>, linux-riscv@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Qingfang Deng <qingfang.deng@...lower.com.cn>
Subject: Re: [PATCH] riscv: do not select MODULE_SECTIONS by default

On Sat, May 11, 2024 at 09:57:25AM +0800, Qingfang Deng wrote:
> From: Qingfang Deng <qingfang.deng@...lower.com.cn>
> 
> Since commit aad15bc85c18 ("riscv: Change code model of module to
> medany to improve data accessing"), kernel modules have not been built
> with -fPIC, so they wouldn't have R_RISCV_GOT_HI20 or R_RISCV_CALL_PLT
> relocations, and handling of those relocations is unnecessary.
> 
> If RELOCATABLE=y, kernel modules will be built with -fPIE, which would
> reintroduce said relocations, so only select MODULE_SECTIONS when
> RELOCATABLE.
> 
> Signed-off-by: Qingfang Deng <qingfang.deng@...lower.com.cn>
> ---
>  arch/riscv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 6bec1bce6586..3f92dd3b45d2 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -169,7 +169,6 @@ config RISCV
>  	select LOCK_MM_AND_FIND_VMA
>  	select MMU_GATHER_RCU_TABLE_FREE if SMP && MMU
>  	select MODULES_USE_ELF_RELA if MODULES
> -	select MODULE_SECTIONS if MODULES
>  	select OF
>  	select OF_EARLY_FLATTREE
>  	select OF_IRQ
> @@ -858,6 +857,7 @@ config PARAVIRT_TIME_ACCOUNTING
>  config RELOCATABLE
>  	bool "Build a relocatable kernel"
>  	depends on MMU && 64BIT && !XIP_KERNEL
> +	select MODULE_SECTIONS if MODULES
>  	help
>            This builds a kernel as a Position Independent Executable (PIE),
>            which retains all relocation metadata required to relocate the
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

Looks great!

Reviewed-by: Charlie Jenkins <charlie@...osinc.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ