Now that stack validation is an optional feature of objtool, add CONFIG_OBJTOOL and replace most usages of CONFIG_STACK_VALIDATION with it. CONFIG_STACK_VALIDATION can now be considered to be frame-pointer specific. CONFIG_UNWINDER_ORC is already inherently valid for live patching, so no need to "validate" it.
Showing the changes to scripts (3 of 17 files). Show all
Unified · Split
| @@ -222,7 +222,7 @@ cmd_record_mcount = $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)), · 221 unmodified lines | |||
| 222 | $(sub_cmd_record_mcount)) | 222 | $(sub_cmd_record_mcount)) |
| 223 | endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT | 223 | endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT |
| 224 | 224 | ||
| 225 | ifdef CONFIG_STACK_VALIDATION | 225 | ifdef CONFIG_OBJTOOL |
| 226 | 226 | ||
| 227 | objtool := $(objtree)/tools/objtool/objtool | 227 | objtool := $(objtree)/tools/objtool/objtool |
| 228 | 228 | ||
| @@ -241,7 +241,7 @@ objtool_args = \ · 12 unmodified lines | |||
| 241 | cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@) | 241 | cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@) |
| 242 | cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd) | 242 | cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd) |
| 243 | 243 | ||
| 244 | endif # CONFIG_STACK_VALIDATION | 244 | endif # CONFIG_OBJTOOL |
| 245 | 245 | ||
| 246 | ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) | 246 | ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) |
| 247 | 247 | ||
| @@ -108,8 +108,11 @@ objtool_link() · 107 unmodified lines | |||
| 108 | local objtoolcmd; | 108 | local objtoolcmd; |
| 109 | local objtoolopt; | 109 | local objtoolopt; |
| 110 | 110 | ||
| 111 | if is_enabled CONFIG_STACK_VALIDATION && \ | 111 | if ! is_enabled CONFIG_OBJTOOL; then |
| 112 | ( is_enabled CONFIG_LTO_CLANG || is_enabled CONFIG_X86_KERNEL_IBT ); then | 112 | return; |
| 113 | fi | ||
| 114 | |||
| 115 | if is_enabled CONFIG_LTO_CLANG || is_enabled CONFIG_X86_KERNEL_IBT; then | ||
| 113 | 116 | ||
| 114 | # Don't perform vmlinux validation unless explicitly requested, | 117 | # Don't perform vmlinux validation unless explicitly requested, |
| 115 | # but run objtool on vmlinux.o now that we have an object file. | 118 | # but run objtool on vmlinux.o now that we have an object file. |
| @@ -126,10 +129,23 @@ objtool_link() · 10 unmodified lines | |||
| 126 | objtoolopt="${objtoolopt} --orc" | 129 | objtoolopt="${objtoolopt} --orc" |
| 127 | fi | 130 | fi |
| 128 | 131 | ||
| 132 | if is_enabled CONFIG_RETPOLINE; then | ||
| 133 | objtoolopt="${objtoolopt} --retpoline" | ||
| 134 | fi | ||
| 135 | |||
| 136 | if is_enabled CONFIG_SLS; then | ||
| 137 | objtoolopt="${objtoolopt} --sls" | ||
| 138 | fi | ||
| 139 | |||
| 129 | if is_enabled CONFIG_STACK_VALIDATION; then | 140 | if is_enabled CONFIG_STACK_VALIDATION; then |
| 130 | objtoolopt="${objtoolopt} --stackval" | 141 | objtoolopt="${objtoolopt} --stackval" |
| 131 | fi | 142 | fi |
| 132 | 143 | ||
| 144 | if is_enabled CONFIG_X86_SMAP; then | ||
| 145 | objtoolopt="${objtoolopt} --uaccess" | ||
| 146 | fi | ||
| 147 | |||
| 148 | |||
| 133 | objtoolopt="${objtoolopt} --lto" | 149 | objtoolopt="${objtoolopt} --lto" |
| 134 | fi | 150 | fi |
| 135 | 151 | ||
| @@ -139,18 +155,6 @@ objtool_link() · 3 unmodified lines | |||
| 139 | 155 | ||
| 140 | if [ -n "${objtoolopt}" ]; then | 156 | if [ -n "${objtoolopt}" ]; then |
| 141 | 157 | ||
| 142 | if is_enabled CONFIG_RETPOLINE; then | ||
| 143 | objtoolopt="${objtoolopt} --retpoline" | ||
| 144 | fi | ||
| 145 | |||
| 146 | if is_enabled CONFIG_SLS; then | ||
| 147 | objtoolopt="${objtoolopt} --sls" | ||
| 148 | fi | ||
| 149 | |||
| 150 | if is_enabled CONFIG_X86_SMAP; then | ||
| 151 | objtoolopt="${objtoolopt} --uaccess" | ||
| 152 | fi | ||
| 153 | |||
| 154 | if ! is_enabled CONFIG_FRAME_POINTER; then | 158 | if ! is_enabled CONFIG_FRAME_POINTER; then |
| 155 | objtoolopt="${objtoolopt} --no-fp" | 159 | objtoolopt="${objtoolopt} --no-fp" |
| 156 | fi | 160 | fi |
| @@ -67,7 +67,7 @@ deploy_kernel_headers () { · 66 unmodified lines | |||
| 67 | ) > debian/hdrsrcfiles | 67 | ) > debian/hdrsrcfiles |
| 68 | 68 | ||
| 69 | { | 69 | { |
| 70 | if is_enabled CONFIG_STACK_VALIDATION; then | 70 | if is_enabled CONFIG_OBJTOOL; then |
| 71 | echo tools/objtool/objtool | 71 | echo tools/objtool/objtool |
| 72 | fi | 72 | fi |
| 73 | 73 | ||