From: Brijesh Singh <brijesh.singh@amd.com>
To: kvm@vger.kernel.org
Cc: "Brijesh Singh" <brijesh.singh@amd.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Borislav Petkov" <bp@suse.de>,
"Tom Lendacky" <thomas.lendacky@amd.com>,
linux-kernel@vger.kernel.org, "Joerg Roedel" <joro@8bytes.org>
Subject: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)
Date: Mon, 19 Feb 2018 10:12:28 -0600 [thread overview]
Message-ID: <20180219161228.46931-1-brijesh.singh@amd.com> (raw)
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
next reply other threads:[~2018-02-19 16:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 16:12 Brijesh Singh [this message]
2018-02-21 17:49 ` [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180219161228.46931-1-brijesh.singh@amd.com \
--to=brijesh.singh@amd.com \
--cc=bp@suse.de \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=thomas.lendacky@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.