From: deraadt Date: Sun, 28 Jan 2024 00:40:22 +0000 (+0000) Subject: set -fno-stack-protector in NORMAL_C_NOP, which is used to compile X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cf019d6cacb198a51e02482aebbc665b89b18783;p=openbsd set -fno-stack-protector in NORMAL_C_NOP, which is used to compile mcount.c, in the same way that -fno-ret-protector is set (because the default ret-protector is an "always" generator). This change ensures there is never a stack protector prologue/epilogue in the functions in that file, no matter what stack protector selection algorithm is in play. ok kettenis guenther --- diff --git a/sys/arch/alpha/conf/Makefile.alpha b/sys/arch/alpha/conf/Makefile.alpha index 4610e49d846..e4717241805 100644 --- a/sys/arch/alpha/conf/Makefile.alpha +++ b/sys/arch/alpha/conf/Makefile.alpha @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.alpha,v 1.115 2021/01/28 17:39:01 deraadt Exp $ +# $OpenBSD: Makefile.alpha,v 1.116 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,7 +51,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-stack-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $< diff --git a/sys/arch/armv7/conf/Makefile.armv7 b/sys/arch/armv7/conf/Makefile.armv7 index 470107e1418..426ec6f71f4 100644 --- a/sys/arch/armv7/conf/Makefile.armv7 +++ b/sys/arch/armv7/conf/Makefile.armv7 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.armv7,v 1.54 2023/09/06 01:47:36 jsg Exp $ +# $OpenBSD: Makefile.armv7,v 1.55 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,7 +51,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-stack-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $< diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index f2c1079de39..e7647347ac1 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.i386,v 1.144 2023/09/06 01:47:37 jsg Exp $ +# $OpenBSD: Makefile.i386,v 1.145 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -66,7 +66,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-stack-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $< diff --git a/sys/arch/landisk/conf/Makefile.landisk b/sys/arch/landisk/conf/Makefile.landisk index 0a975c26185..0ab579bf539 100644 --- a/sys/arch/landisk/conf/Makefile.landisk +++ b/sys/arch/landisk/conf/Makefile.landisk @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.landisk,v 1.82 2021/01/28 17:39:03 deraadt Exp $ +# $OpenBSD: Makefile.landisk,v 1.83 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,7 +51,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-stack-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $< diff --git a/sys/arch/luna88k/conf/Makefile.luna88k b/sys/arch/luna88k/conf/Makefile.luna88k index d32a29c2f28..07ce32a019a 100644 --- a/sys/arch/luna88k/conf/Makefile.luna88k +++ b/sys/arch/luna88k/conf/Makefile.luna88k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.luna88k,v 1.84 2021/01/28 17:39:03 deraadt Exp $ +# $OpenBSD: Makefile.luna88k,v 1.85 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,7 +51,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-stack-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $< PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \ diff --git a/sys/arch/macppc/conf/Makefile.macppc b/sys/arch/macppc/conf/Makefile.macppc index 091c5dc8f99..554636b54ad 100644 --- a/sys/arch/macppc/conf/Makefile.macppc +++ b/sys/arch/macppc/conf/Makefile.macppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.macppc,v 1.106 2023/09/06 01:47:37 jsg Exp $ +# $OpenBSD: Makefile.macppc,v 1.107 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -66,7 +66,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-ret-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $< diff --git a/sys/arch/sparc64/conf/Makefile.sparc64 b/sys/arch/sparc64/conf/Makefile.sparc64 index 336b1104460..1a969ed4f53 100644 --- a/sys/arch/sparc64/conf/Makefile.sparc64 +++ b/sys/arch/sparc64/conf/Makefile.sparc64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sparc64,v 1.107 2024/01/26 15:11:18 deraadt Exp $ +# $OpenBSD: Makefile.sparc64,v 1.108 2024/01/28 00:40:22 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -60,7 +60,7 @@ HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} HOSTED_CFLAGS= ${CFLAGS} HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< +NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -fno-stack-protector -c $< NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} ${PROF} -c $<