diff options
-rw-r--r-- | arch/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | scripts/Makefile.build | 2 | ||||
-rwxr-xr-x | scripts/link-vmlinux.sh | 4 |
4 files changed, 9 insertions, 2 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 904ed51736d4..cb2954027d10 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1050,6 +1050,10 @@ config HAVE_NOINSTR_HACK config HAVE_NOINSTR_VALIDATION bool +config HAVE_UACCESS_VALIDATION + bool + select OBJTOOL + config HAVE_STACK_VALIDATION bool help diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cf531fbcd229..5f41f3c3df9a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -258,6 +258,7 @@ config X86 select HAVE_PREEMPT_DYNAMIC_CALL select HAVE_RSEQ select HAVE_SYSCALL_TRACEPOINTS + select HAVE_UACCESS_VALIDATION if HAVE_OBJTOOL select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_USER_RETURN_NOTIFIER select HAVE_GENERIC_VDSO diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 06400504150b..6a663b27b286 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -218,7 +218,7 @@ objtool_args = \ $(if $(CONFIG_SLS), --sls) \ $(if $(CONFIG_STACK_VALIDATION), --stackval) \ $(if $(CONFIG_HAVE_STATIC_CALL_INLINE), --static-call) \ - --uaccess \ + $(if $(CONFIG_HAVE_UACCESS_VALIDATION), --uaccess) \ $(if $(linked-object), --link) \ $(if $(part-of-module), --module) \ $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index a7f6196c7e41..fd578c380919 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -134,7 +134,9 @@ objtool_link() objtoolopt="${objtoolopt} --static-call" fi - objtoolopt="${objtoolopt} --uaccess" + if is_enabled CONFIG_HAVE_UACCESS_VALIDATION; then + objtoolopt="${objtoolopt} --uaccess" + fi fi if is_enabled CONFIG_NOINSTR_VALIDATION; then |