[PATCH v6 01/41] arm64: kernel: Disable latent_entropy GCC plugin in early C runtime

Anshuman Khandual anshuman.khandual at arm.com
Wed Nov 29 20:44:13 PST 2023



On 11/29/23 16:45, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb at kernel.org>
> 
> In subsequent patches, mark portions of the early C code will be marked

Small nit - 		 ^^^ redundant usage for mark		   ^^^^^^

> as __init.  Unfortunarely, __init implies __latent_entropy, and this

Typo here - s/Unfortunarely/Unfortunately/

> would result in the early C code being instrumented in an unsafe manner.
> 
> Disable the latent entropy plugin for the early C code.

I am just wondering if this '__latent_entropy' could be problematic for all
early __init code in each supported platform. Although this plugin does not
get disabled in that many places inside the kernel tree.

$git grep DISABLE_LATENT_ENTROPY_PLUGIN
arch/arm64/kernel/pi/Makefile:             $(DISABLE_LATENT_ENTROPY_PLUGIN) \
arch/powerpc/kernel/Makefile:CFLAGS_early_32.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/kernel/Makefile:CFLAGS_cputable.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/kernel/Makefile:CFLAGS_prom_init.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/kernel/Makefile:CFLAGS_btext.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/kernel/Makefile:CFLAGS_prom.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/kernel/vdso/Makefile:  CFLAGS_vgettimeofday-32.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/kernel/vdso/Makefile:  CFLAGS_vgettimeofday-64.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/lib/Makefile:CFLAGS_code-patching.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/lib/Makefile:CFLAGS_feature-fixups.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
scripts/Makefile.gcc-plugins:    DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN
scripts/Makefile.gcc-plugins:export DISABLE_LATENT_ENTROPY_PLUGIN

> 
> Acked-by: Mark Rutland <mark.rutland at arm.com>
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
> ---
>  arch/arm64/kernel/pi/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile
> index 4c0ea3cd4ea4..c844a0546d7f 100644
> --- a/arch/arm64/kernel/pi/Makefile
> +++ b/arch/arm64/kernel/pi/Makefile
> @@ -3,6 +3,7 @@
>  
>  KBUILD_CFLAGS	:= $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \
>  		   -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \
> +		   $(DISABLE_LATENT_ENTROPY_PLUGIN) \
>  		   $(call cc-option,-mbranch-protection=none) \
>  		   -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
>  		   -include $(srctree)/include/linux/hidden.h \



More information about the linux-arm-kernel mailing list