Commit a1ccfd6
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.com1 parent 243b1f6 commit a1ccfd6
1 file changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
999 | 999 | | |
1000 | 1000 | | |
1001 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
1002 | 1006 | | |
1003 | 1007 | | |
1004 | 1008 | | |
1005 | 1009 | | |
1006 | 1010 | | |
1007 | 1011 | | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | 1012 | | |
1012 | 1013 | | |
1013 | 1014 | | |
| |||
1101 | 1102 | | |
1102 | 1103 | | |
1103 | 1104 | | |
1104 | | - | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1105 | 1111 | | |
1106 | 1112 | | |
1107 | 1113 | | |
| |||
1256 | 1262 | | |
1257 | 1263 | | |
1258 | 1264 | | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1259 | 1269 | | |
1260 | 1270 | | |
1261 | 1271 | | |
| |||
2491 | 2501 | | |
2492 | 2502 | | |
2493 | 2503 | | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
2494 | 2509 | | |
2495 | 2510 | | |
2496 | 2511 | | |
| |||
2517 | 2532 | | |
2518 | 2533 | | |
2519 | 2534 | | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
2520 | 2539 | | |
2521 | 2540 | | |
2522 | 2541 | | |
| |||
0 commit comments