kernel_samsung_a53x/arch/arm64/kvm/vgic
Oliver Upton 22e90035c9 KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache
commit ad362fe07fecf0aba839ff2cc59a3617bd42c33f upstream.

There is a potential UAF scenario in the case of an LPI translation
cache hit racing with an operation that invalidates the cache, such
as a DISCARD ITS command. The root of the problem is that
vgic_its_check_cache() does not elevate the refcount on the vgic_irq
before dropping the lock that serializes refcount changes.

Have vgic_its_check_cache() raise the refcount on the returned vgic_irq
and add the corresponding decrement after queueing the interrupt.

Cc: stable@vger.kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240104183233.3560639-1-oliver.upton@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 12:12:48 +01:00
..
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-init.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-irqfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-its.c KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache 2024-11-18 12:12:48 +01:00
vgic-kvm-device.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-mmio-v2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-mmio-v3.c KVM: arm64: vgic-v4: Restore pending state on host userspace write 2024-11-18 12:12:48 +01:00
vgic-mmio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-mmio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-v2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-v3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic-v4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vgic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00