]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: vgic: Do not ignore vgic_its_restore_cte failures
authorRicardo Koller <ricarkol@google.com>
Tue, 10 May 2022 00:16:32 +0000 (17:16 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 16 May 2022 12:58:04 +0000 (13:58 +0100)
commit82e1fe2bf262e48065236ad62aa6be75219a8fa2
treeba73bfaf755f6b8ca9947a79b6b983670840931f
parent270e5f87fe191663a742b636de31690207b16198
KVM: arm64: vgic: Do not ignore vgic_its_restore_cte failures

Restoring a corrupted collection entry (like an out of range ID) is
being ignored and treated as success. More specifically, a
vgic_its_restore_cte failure is treated as success by
vgic_its_restore_collection_table.  vgic_its_restore_cte uses positive
and negative numbers to return error, and +1 to return success.  The
caller then uses "ret > 0" to check for success.

Fix this by having vgic_its_restore_cte only return negative numbers on
error.  Do this by changing alloc_collection return codes to only return
negative numbers on error.

Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220510001633.552496-4-ricarkol@google.com
arch/arm64/kvm/vgic/vgic-its.c