arm64: entry: Place an SB sequence following an ERET instruction
authorWill Deacon <will.deacon@arm.com>
Thu, 14 Jun 2018 10:23:38 +0000 (11:23 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 6 Dec 2018 16:47:05 +0000 (16:47 +0000)
commit679db70801da9fda91d26caf13bf5b5ccc74e8e8
tree99b7df12e3d5dbdb4d14cd0fe317b643ee7a1444
parentbd4fb6d270bc423a9a4098108784f7f9254c4e6d
arm64: entry: Place an SB sequence following an ERET instruction

Some CPUs can speculate past an ERET instruction and potentially perform
speculative accesses to memory before processing the exception return.
Since the register state is often controlled by a lower privilege level
at the point of an ERET, this could potentially be used as part of a
side-channel attack.

This patch emits an SB sequence after each ERET so that speculation is
held up on exception return.

Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/entry.S
arch/arm64/kvm/hyp/entry.S
arch/arm64/kvm/hyp/hyp-entry.S