Skip to content

Commit 5f3da8c

Browse files
jpoimboePeter Zijlstra
authored andcommitted
objtool: Add CONFIG_HAVE_UACCESS_VALIDATION
Allow an arch specify that it has objtool uaccess validation with CONFIG_HAVE_UACCESS_VALIDATION. For now, doing so unconditionally selects CONFIG_OBJTOOL. Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/d393d5e2fe73aec6e8e41d5c24f4b6fe8583f2d8.1650384225.git.jpoimboe@redhat.com
1 parent 7e28407 commit 5f3da8c

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

arch/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,10 @@ config HAVE_NOINSTR_HACK
10501050
config HAVE_NOINSTR_VALIDATION
10511051
bool
10521052

1053+
config HAVE_UACCESS_VALIDATION
1054+
bool
1055+
select OBJTOOL
1056+
10531057
config HAVE_STACK_VALIDATION
10541058
bool
10551059
help

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ config X86
258258
select HAVE_PREEMPT_DYNAMIC_CALL
259259
select HAVE_RSEQ
260260
select HAVE_SYSCALL_TRACEPOINTS
261+
select HAVE_UACCESS_VALIDATION if HAVE_OBJTOOL
261262
select HAVE_UNSTABLE_SCHED_CLOCK
262263
select HAVE_USER_RETURN_NOTIFIER
263264
select HAVE_GENERIC_VDSO

scripts/Makefile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ objtool_args = \
218218
$(if $(CONFIG_SLS), --sls) \
219219
$(if $(CONFIG_STACK_VALIDATION), --stackval) \
220220
$(if $(CONFIG_HAVE_STATIC_CALL_INLINE), --static-call) \
221-
--uaccess \
221+
$(if $(CONFIG_HAVE_UACCESS_VALIDATION), --uaccess) \
222222
$(if $(linked-object), --link) \
223223
$(if $(part-of-module), --module) \
224224
$(if $(CONFIG_GCOV_KERNEL), --no-unreachable)

scripts/link-vmlinux.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ objtool_link()
134134
objtoolopt="${objtoolopt} --static-call"
135135
fi
136136

137-
objtoolopt="${objtoolopt} --uaccess"
137+
if is_enabled CONFIG_HAVE_UACCESS_VALIDATION; then
138+
objtoolopt="${objtoolopt} --uaccess"
139+
fi
138140
fi
139141

140142
if is_enabled CONFIG_NOINSTR_VALIDATION; then

0 commit comments

Comments
 (0)