arm64: use function_nocfi with __pa_symbol
With CONFIG_CFI_CLANG, the compiler replaces function address references with the address of the function's CFI jump table entry. This means that __pa_symbol(function) returns the physical address of the jump table entry, which can lead to address space confusion as the jump table points to the function's virtual address. Therefore, use the function_nocfi() macro to ensure we are always taking the address of the actual function instead. 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-14-samitolvanen@google.com
Showing
- arch/arm64/include/asm/mmu_context.h 1 addition, 1 deletionarch/arm64/include/asm/mmu_context.h
- arch/arm64/kernel/acpi_parking_protocol.c 2 additions, 1 deletionarch/arm64/kernel/acpi_parking_protocol.c
- arch/arm64/kernel/cpu-reset.h 1 addition, 1 deletionarch/arm64/kernel/cpu-reset.h
- arch/arm64/kernel/cpufeature.c 1 addition, 1 deletionarch/arm64/kernel/cpufeature.c
- arch/arm64/kernel/psci.c 2 additions, 1 deletionarch/arm64/kernel/psci.c
- arch/arm64/kernel/smp_spin_table.c 2 additions, 1 deletionarch/arm64/kernel/smp_spin_table.c
Loading
Please register or sign in to comment