All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)
@ 2018-02-19 16:12 Brijesh Singh
  2018-02-21 17:49 ` Al Viro
  0 siblings, 1 reply; 7+ messages in thread
From: Brijesh Singh @ 2018-02-19 16:12 UTC (permalink / raw)
  To: kvm
  Cc: Brijesh Singh, Paolo Bonzini, Radim Krčmář,
	Borislav Petkov, Tom Lendacky, linux-kernel, Joerg Roedel

Fix sparse: incorrect type in argument 1 (different base types). Typecast
the userspace address argument.

Fixes: 0d0736f76347 (KVM: SVM: Add support for KVM_SEV_LAUNCH_MEASURE ...)
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-kernel@vger.kernel.org
Cc: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
 arch/x86/kvm/svm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index b3e488a74828..a2f1bb73640c 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -6262,7 +6262,9 @@ static int sev_launch_measure(struct kvm *kvm, struct kvm_sev_cmd *argp)
 			goto e_free;
 		}
 
-		if (!access_ok(VERIFY_WRITE, params.uaddr, params.len)) {
+		if (!access_ok(VERIFY_WRITE,
+			       (void __user *)(uintptr_t)params.uaddr,
+			       params.len)) {
 			ret = -EFAULT;
 			goto e_free;
 		}
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-23 18:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 16:12 [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types) Brijesh Singh
2018-02-21 17:49 ` Al Viro
2018-02-21 19:59   ` Brijesh Singh
2018-02-21 20:18     ` Al Viro
2018-02-22 15:56       ` Brijesh Singh
2018-02-23 18:05         ` Paolo Bonzini
2018-02-23 18:26           ` Brijesh Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.