From f177a280b1e5f99759fb029f4470131ea8a2c375 Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Fri, 14 Oct 2022 13:42:37 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Fix MMIO guard map error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pierre-Clément reports that the error codes returned by the MMIO guard map hypercall may end up being incorrectly reported as positive to callers who interpret them a signed 64-bit integers, as specified in the SMCCC. Fix this by storing the return value in a 64-bit variable instead. Bug: 253586500 Reported-by: Pierre-Clément Tosi Signed-off-by: Quentin Perret Change-Id: I3092856ec1a1fd1648a75c9e4ad4bfebd8830d14 --- arch/arm64/kvm/hyp/nvhe/pkvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c index 3caa670a18cb..b9e6337852dd 100644 --- a/arch/arm64/kvm/hyp/nvhe/pkvm.c +++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c @@ -1246,7 +1246,7 @@ out_guest_err: static bool pkvm_install_ioguard_page(struct kvm_vcpu *vcpu, u64 *exit_code) { - u32 retval = SMCCC_RET_SUCCESS; + u64 retval = SMCCC_RET_SUCCESS; u64 ipa = smccc_get_arg1(vcpu); int ret;