Skip to content

Commit

Permalink
ANDROID: arm64: mark kpti_install_ng_mappings as __nocfi
Browse files Browse the repository at this point in the history
4.9.93 panics on boot when CFI_CLANG and UNMAP_KERNEL_AT_EL0 are both
enabled.  From Sami Tolvanen:

"kpti_install_ng_mappings makes an indirect call to a physical address,
which trips CFI. Adding the __nocfi attribute to this function should
fix the problem."

Bug: 77811249
Change-Id: I87d1ceb29f1ba2caee8954547596f4236bdfc31f
Reported-by: Jean-Baptiste Theou <[email protected]>
Signed-off-by: Greg Hackmann <[email protected]>
  • Loading branch information
greghackmann authored and pundiramit committed Aug 28, 2018
1 parent 1d584fe commit 6e85026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
return !has_cpuid_feature(entry, scope);
}

static void
static void __nocfi
kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
{
typedef void (kpti_remap_fn)(int, int, phys_addr_t);
Expand Down

0 comments on commit 6e85026

Please sign in to comment.