diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2021-04-08 11:28:28 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2021-04-08 16:04:21 -0700 |
commit | 5caf968262df0ec7a3377fb67d4a6bfa979cb028 (patch) | |
tree | da8b0f692f2d79604ef9c9731e1b1ed0fe640251 /scripts/module.lds.S | |
parent | ff301ceb5299551c3650d0e07ba879b766da4cc0 (diff) |
mm: add generic function_nocfi macro
With CONFIG_CFI_CLANG, the compiler replaces function addresses
in instrumented C code with jump table addresses. This means that
__pa_symbol(function) returns the physical address of the jump table
entry instead of the actual function, which may not work as the jump
table code will immediately jump to a virtual address that may not be
mapped.
To avoid this address space confusion, this change adds a generic
definition for function_nocfi(), which architectures that support CFI
can override. The typical implementation of would use inline assembly
to take the function address, which avoids compiler instrumentation.
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210408182843.1754385-4-samitolvanen@google.com
Diffstat (limited to 'scripts/module.lds.S')
0 files changed, 0 insertions, 0 deletions