summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorBenjamin Gray <bgray@linux.ibm.com>2024-04-17 21:23:19 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2024-05-03 20:46:51 +1000
commitbbd99922d0f4518518282217159666c679c6a0d1 (patch)
tree6c2d20d8594157030d86f67582c38370560ccf0b /arch/powerpc/include
parent75171f06c4507c3b6b5a69d793879fb20d108bb1 (diff)
downloadlinux-stable-bbd99922d0f4518518282217159666c679c6a0d1.tar.gz
linux-stable-bbd99922d0f4518518282217159666c679c6a0d1.tar.bz2
linux-stable-bbd99922d0f4518518282217159666c679c6a0d1.zip
powerpc/dexcr: Reset DEXCR value across exec
Inheriting the DEXCR across exec can have security and usability concerns. If a program is compiled with hash instructions it generally expects to run with NPHIE enabled. But if the parent process disables NPHIE then if it's not careful it will be disabled for any children too and the protection offered by hash checks is basically worthless. This patch introduces a per-process reset value that new execs in a particular process tree are initialized with. This enables fine grained control over what DEXCR value child processes run with by default. For example, containers running legacy binaries that expect hash instructions to act as NOPs could configure the reset value of the container root to control the default reset value for all members of the container. Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> [mpe: Add missing SPDX tag on dexcr.c] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240417112325.728010-4-bgray@linux.ibm.com
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/processor.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 882e31296ea6..aad85a24134a 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -261,7 +261,7 @@ struct thread_struct {
unsigned long sier3;
unsigned long hashkeyr;
unsigned long dexcr;
-
+ unsigned long dexcr_onexec; /* Reset value to load on exec */
#endif
};