diff mbox series

um: Enable FORTIFY_SOURCE

Message ID 20220210003224.773957-1-keescook@chromium.org (mailing list archive)
State Accepted
Commit ba38961a069b0d8d03b53218a6c29d737577d448
Headers show
Series um: Enable FORTIFY_SOURCE | expand

Commit Message

Kees Cook Feb. 10, 2022, 12:32 a.m. UTC
Enable FORTIFY_SOURCE so running Kunit tests can test fortified
functions.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/um/Kconfig              | 1 +
 arch/um/os-Linux/user_syms.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 4d398b80aea8..746e661395d7 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -9,6 +9,7 @@  config UML
 	select ARCH_HAS_KCOV
 	select ARCH_HAS_STRNCPY_FROM_USER
 	select ARCH_HAS_STRNLEN_USER
+	select ARCH_HAS_FORTIFY_SOURCE
 	select ARCH_NO_PREEMPT
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_ARCH_SECCOMP_FILTER
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 715594fe5719..d9845b5219ce 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -1,4 +1,5 @@ 
 // SPDX-License-Identifier: GPL-2.0
+#define __NO_FORTIFY
 #include <linux/types.h>
 #include <linux/module.h>