mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
LoongArch: KVM: Check the return values for put_user()
put_user() may return -EFAULT, so, when the user space address is invalid, the caller should return -EFAULT. Cc: stable@vger.kernel.org Reviewed-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Qiang Ma <maqianga@uniontech.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
83551ccedf
commit
fb89e0fe2d
|
|
@ -1106,7 +1106,8 @@ static int kvm_loongarch_cpucfg_get_attr(struct kvm_vcpu *vcpu,
|
|||
return -ENXIO;
|
||||
}
|
||||
|
||||
put_user(val, uaddr);
|
||||
if (put_user(val, uaddr))
|
||||
return -EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user