This is a note to let you know that I've just added the patch titled powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR to the 5.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-32-fix-boot-failure-with-config_stackprotector.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f5668260b872e89b8d3942a8b7d4278aa9c2c981 Mon Sep 17 00:00:00 2001 From: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Date: Thu, 29 Apr 2021 16:52:09 +0000 Subject: powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR From: Christophe Leroy <christophe.leroy@xxxxxxxxxx> commit f5668260b872e89b8d3942a8b7d4278aa9c2c981 upstream. Commit 7c95d8893fb5 ("powerpc: Change calling convention for create_branch() et. al.") complexified the frame of function do_feature_fixups(), leading to GCC setting up a stack guard when CONFIG_STACKPROTECTOR is selected. The problem is that do_feature_fixups() is called very early while 'current' in r2 is not set up yet and the code is still not at the final address used at link time. So, like other instrumentation, stack protection needs to be deactivated for feature-fixups.c and code-patching.c Fixes: 7c95d8893fb5 ("powerpc: Change calling convention for create_branch() et. al.") Cc: stable@xxxxxxxxxxxxxxx # v5.8+ Reported-by: Jonathan Neuschaefer <j.neuschaefer@xxxxxxx> Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Tested-by: Jonathan Neuschaefer <j.neuschaefer@xxxxxxx> Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/b688fe82927b330349d9e44553363fa451ea4d95.1619715114.git.christophe.leroy@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/lib/Makefile | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -5,6 +5,9 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) +CFLAGS_code-patching.o += -fno-stack-protector +CFLAGS_feature-fixups.o += -fno-stack-protector + CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE) Patches currently in stable-queue which might be from christophe.leroy@xxxxxxxxxx are queue-5.12/powerpc-vdso-separate-vvar-vma-from-vdso.patch queue-5.12/powerpc-32-fix-boot-failure-with-config_stackprotector.patch