Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 115d0767 authored by Shanker Donthineni's avatar Shanker Donthineni Committed by Gerrit - the friendly Code Review server
Browse files

arm64: Implement branch predictor hardening for Falkor



Falkor is susceptible to branch predictor aliasing and can
theoretically be attacked by malicious code. This patch
implements a mitigation for these attacks, preventing any
malicious entries from affecting other victim contexts.

Change-Id: Ieb49196c23582c3174f778891ff2ab7cdc96be54
Signed-off-by: default avatarShanker Donthineni <shankerd@codeaurora.org>
[will: fix label name when !CONFIG_KVM and remove references to MIDR_FALKOR]
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Git-commit: ec82b567a74fbdffdf418d4bb381d55f6a9096af
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux


[neeraju@codeaurora.org: resolve merge conflicts.
 Take only qcom_link_stack_sanitization() definition]
Signed-off-by: default avatarNeeraj Upadhyay <neeraju@codeaurora.org>
parent 16995f67
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -146,6 +146,19 @@ static void enable_psci_bp_hardening(void *data)
				       __psci_hyp_bp_inval_end);

}

static void __maybe_unused qcom_link_stack_sanitization(void)
{
	u64 tmp;

	asm volatile("mov	%0, x30		\n"
		     ".rept	16		\n"
		     "bl	. + 4		\n"
		     ".endr			\n"
		     "mov	x30, %0		\n"
		     : "=&r" (tmp));
}

#endif	/* CONFIG_HARDEN_BRANCH_PREDICTOR */

#define MIDR_RANGE(model, min, max) \