Message ID | 20200428172433.48830-2-broonie@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: Make NOP handling a whitelist | expand |
On Tue, Apr 28, 2020 at 06:24:31PM +0100, Mark Brown wrote: > Currently the kernel assumes that any HINT which it does not explicitly > recognise is a NOP. This is not robust as new instructions may be added > which need special handling, including recent extensions like PAC, and > in any case software should only be using explicit NOP instructions for > deliberate NOPs. Hmm, I'm not sure that using PAC as the justification makes tonnes of sense here, since you go ahead and whitelist the PAC hints in patch 3! Will
diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index 4a9e773a177f..535a3a7a053e 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -58,14 +58,10 @@ bool __kprobes aarch64_insn_is_nop(u32 insn) return false; switch (insn & 0xFE0) { - case AARCH64_INSN_HINT_YIELD: - case AARCH64_INSN_HINT_WFE: - case AARCH64_INSN_HINT_WFI: - case AARCH64_INSN_HINT_SEV: - case AARCH64_INSN_HINT_SEVL: - return false; - default: + case AARCH64_INSN_HINT_NOP: return true; + default: + return false; } }