Commit e3f3950b authored by Ricardo Koller's avatar Ricardo Koller Committed by Will Deacon
Browse files

UPSTREAM: 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: default avatarRicardo Koller <ricarkol@google.com>
Reviewed-by: default avatarOliver Upton <oupton@google.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220510001633.552496-4-ricarkol@google.com


(cherry picked from commit a1ccfd6f)
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: I72088a9d4b97bc8a03787aa1145e64401b7935ec
parent d21726ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment