]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: vgic: fix possible spectre-v1 in vgic_get_irq()
authorMark Rutland <mark.rutland@arm.com>
Wed, 25 Apr 2018 16:13:41 +0000 (17:13 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 26 Apr 2018 16:02:37 +0000 (17:02 +0100)
commit3cdf49209877437e8a75e605bdaef2b5321447ea
tree9d2911554c552c48dc3b764708aa7d96bbe6f348
parent527d9dac2e80b1306247f9ecc28d60ee08fd8a14
KVM: arm/arm64: vgic: fix possible spectre-v1 in vgic_get_irq()

It's possible for userspace to control intid. Sanitize intid when using
it as an array index.

At the same time, sort the includes when adding <linux/nospec.h>.

Found by smatch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: kvmarm@lists.cs.columbia.edu
Signed-off-by: Will Deacon <will.deacon@arm.com>
virt/kvm/arm/vgic/vgic.c