diff options
| author | Sascha Bischoff <Sascha.Bischoff@arm.com> | 2026-08-11 15:10:47 +0000 |
|---|---|---|
| committer | Oliver Upton <oupton@kernel.org> | 2026-08-19 12:23:01 -0700 |
| commit | 93cfad8da7164b095b2402ec9b2067fa15d6f250 (patch) | |
| tree | 89234befa8767264877ec5c03e33a47f0adeaf22 /include/linux/workqueue_api.h | |
| parent | d3a1b28ea25d4c1899a05833e1a9bc79d7c642c3 (diff) | |
KVM: arm64: vgic: Prevent speculative SPI array underflow
For a non-GICv5 VM, SPI interrupt IDs include the private-interrupt
offset, while KVM's SPI array is indexed from zero. The lookup applies
array_index_nospec() to the absolute interrupt ID and subtracts the
private-interrupt offset afterwards.
On a speculative bypass of the range check for an interrupt ID below
the private range, the clamp preserves the small absolute value and
the subtraction underflows to an out-of-bounds SPI array index.
Convert the interrupt ID to a zero-based index into the SPI array
before applying array_index_nospec(). This way, we ensure that we
clamp to a reachable SPI ID, rather than an out-of-range SPI index.
Fixes: 41b87599c743 ("KVM: arm/arm64: vgic: fix possible spectre-v1 in vgic_get_irq()")
Link: https://sashiko.dev/#/patchset/20260724104819.1296803-1-sascha.bischoff@arm.com?part=27
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://patch.msgid.link/20260811150941.941295-3-sascha.bischoff@arm.com
Signed-off-by: Oliver Upton <oupton@kernel.org>
Diffstat (limited to 'include/linux/workqueue_api.h')
0 files changed, 0 insertions, 0 deletions
