In order to avoid declaration ambiguity with more than one capability pointer levels, provide explicit __capability annotations, thus avoiding compilation issues with implicit casting. NOTE: This is far from being perfect and should be done in a more elegant manner but for now it has to do.
Signed-off-by: Beata Michalska beata.michalska@arm.com --- arch/arm64/kvm/sys_regs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 4735e1b37fb3..1c5d24fb7733 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -3653,7 +3653,12 @@ static u64 sys_reg_to_index(const struct sys_reg_desc *reg) (reg->Op2 << KVM_REG_ARM64_SYSREG_OP2_SHIFT)); }
-static bool copy_reg_to_user(const struct sys_reg_desc *reg, u64 __user **uind) +static bool copy_reg_to_user(const struct sys_reg_desc *reg, +#ifdef CONFIG_CHERI_PURECAP_UABI + u64 * __capability * uind) +#else + u64 __user **uind) +#endif { if (!*uind) return true; @@ -3667,7 +3672,11 @@ static bool copy_reg_to_user(const struct sys_reg_desc *reg, u64 __user **uind)
static int walk_one_sys_reg(const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, +#ifdef CONFIG_CHERI_PURECAP_UABI + u64 * __capability * uind, +#else u64 __user **uind, +#endif unsigned int *total) { /*