diff options
| author | Linus Walleij <[email protected]> | 2024-04-23 07:29:31 +0000 |
|---|---|---|
| committer | Russell King (Oracle) <[email protected]> | 2024-04-29 13:14:16 +0000 |
| commit | 1036b89580dc611cfb5dfe66af6b35452dfb272c (patch) | |
| tree | 8af0e6080d0557da7d6bfb095f23022debf50052 /arch/powerpc/lib/code-patching.c | |
| parent | ARM: 9384/2: mm: Make tlbflush routines CFI safe (diff) | |
| download | kernel-1036b89580dc611cfb5dfe66af6b35452dfb272c.tar.gz kernel-1036b89580dc611cfb5dfe66af6b35452dfb272c.zip | |
ARM: 9385/2: mm: Type-annotate all cache assembly routines
Tag all references to assembly functions with SYM_TYPED_FUNC_START()
and SYM_FUNC_END() so they also become CFI-safe.
When we add SYM_TYPED_FUNC_START() to assembly calls, a function
prototype signature will be emitted into the object file at
(pc-4) at the call site, so that the KCFI runtime check can compare
this to the expected call. Example:
8011ae38: a540670c .word 0xa540670c
8011ae3c <v7_flush_icache_all>:
8011ae3c: e3a00000 mov r0, #0
8011ae40: ee070f11 mcr 15, 0, r0, cr7, cr1, {0}
8011ae44: e12fff1e bx lr
This means no "fallthrough" code can enter a SYM_TYPED_FUNC_START()
call from above it: there will be a function prototype signature
there, so those are consistently converted to a branch or ret lr
depending on context.
Tested-by: Kees Cook <[email protected]>
Reviewed-by: Sami Tolvanen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
0 files changed, 0 insertions, 0 deletions
