Skip to content

arm64: mitigate CVE-2024-7881 in the absence of firmware mitigation

Mark Rutland kvmarm linux-arm-kernel 1 version Applied

Status from this message: Applied to arm64 (for-next/leaky-prefetcher), thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 9 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4arm64: cpufeature: rename unmap_kernel_at_el0() -> needs_kpti()arch/arm64/kernel/cpufeature.c+4 -60 replies
2/4arm64: cpufeature: factor out cpu_is_meltdown_safe()arch/arm64/kernel/cpufeature.c+27 -160 replies
3/4arm64: cpufeature: mitigate CVE-2024-7881arch/arm64/kernel/cpufeature.c include/linux/arm-smccc.h+38 -10 replies
4/4KVM: arm64: expose SMCCC_ARCH_WORKAROUND_4 to guestsarch/arm64/include/asm/spectre.h arch/arm64/include/uapi/asm/kvm.h arch/arm64/kernel/cpufeature.c +1 more+41 -00 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchOliver Upton
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] arm64: mitigate CVE-2024-7881 in the absence of firmware mitigation

On some CPUs from Arm Ltd, it is possible for unprivileged code to cause a hardware prefetcher to form an address using the contents of a memory location which is accessible by privileged accesses in the active translation regime, potentially leaking the contents of this memory location via a side channel. This has been assigned CVE-2024-7881:

https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-7881

Arm's recommended mitigation is that firmware configures an IMPLEMENTATION DEFINED control bit (CPUACTLR6_EL1[41]) to disable the affected prefetcher, and updates to Trusted Firmware-A are available to do this. For systems which have not yet recevied a firmware update, KPTI can help to mitigate the issue.

These patches enable KPTI for affected parts when the firmware mitigation is not present. The presence of the mitigation is identified by the presence of the SMCCC_ARCH_WORKAROUND_4 SMCCC call, which was deployed with the mitigation. This is documented in the SMCCC 1.6 G BET0 specification:

https://developer.arm.com/documentation/den0028/gbet0/?lang=en

I have tested this on a few configurations of virtual platforms. I'd appreciate any feedback, especially on the KVM changes.

Mark.

Mark Rutland (4):
arm64: cpufeature: rename unmap_kernel_at_el0() -> needs_kpti()
arm64: cpufeature: factor out cpu_is_meltdown_safe()
arm64: cpufeature: mitigate CVE-2024-7881
KVM: arm64: expose SMCCC_ARCH_WORKAROUND_4 to guests

 arch/arm64/include/asm/spectre.h  |  2 +
 arch/arm64/include/uapi/asm/kvm.h |  4 ++
 arch/arm64/kernel/cpufeature.c    | 95 ++++++++++++++++++++++++-------
 arch/arm64/kvm/hypercalls.c       | 21 +++++++
 include/linux/arm-smccc.h         |  5 ++
 5 files changed, 107 insertions(+), 20 deletions(-)
Signature · 1 line
2.30.2