projects/linux·commit e534e9d1

virt: arm-cca-guest: fix error check for RSI_INCOMPLETE

e534e9d1 · Sami Mujawar <[email protected]> · 2026-04-10 17:36:36 +01:00

The RSI interface can return RSI_INCOMPLETE when a report spans
multiple granules. This is an expected condition and should not be
treated as a fatal error.

Currently, arm_cca_report_new() checks for `info.result != RSI_SUCCESS`
and bails out, which incorrectly flags RSI_INCOMPLETE as a failure.
Fix the check to only break out on results other than RSI_SUCCESS or
RSI_INCOMPLETE.

This ensures partial reports are handled correctly and avoids spurious
-ENXIO errors when generating attestation reports.

Fixes: 7999edc484ca ("virt: arm-cca-guest: TSM_REPORT support for realms")
Signed-off-by: Sami Mujawar <[email protected]>
Reported-by: Jagdish Gediya <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Reviewed-by: Gavin Shan <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Reviewed-by: Yeoreum Yun <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
Commit
e534e9d13d0b7bdbb2cccdace7b96b769a10540e
Parents
680b961e

Changes

1 files changed · +2 −1

FileStatusAddDelContent
drivers/virt/coco/arm-cca-guest/arm-cca-guest.cmodified+2−1View file

drivers/virt/coco/arm-cca-guest/arm-cca-guest.c

View file
diff --git a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
index 0c9ea24..66d00b6 100644
--- a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
+++ b/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
@@ -157,7 +157,8 @@ static int arm_cca_report_new(struct tsm_report *report, void *data)
} while (info.result == RSI_INCOMPLETE &&
info.offset < RSI_GRANULE_SIZE);
- if (info.result != RSI_SUCCESS) {
+ /* Break out in case of failure */
+ if (info.result != RSI_SUCCESS && info.result != RSI_INCOMPLETE) {
ret = -ENXIO;
token_size = 0;
goto exit_free_granule_page;