From: Brijesh Singh <brijesh.singh@amd.com>
To: Paolo Bonzini <pbonzini@redhat.com>, Al Viro <viro@ZenIV.linux.org.uk>
Cc: brijesh.singh@amd.com, kvm@vger.kernel.org,
"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: Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)
Date: Fri, 23 Feb 2018 12:26:40 -0600 [thread overview]
Message-ID: <f593be03-4cb1-5569-e8dd-9b1ef6557798@amd.com> (raw)
In-Reply-To: <561de7e2-84a6-7372-b561-b035ff390ac5@redhat.com>
On 02/23/2018 12:05 PM, Paolo Bonzini wrote:
> On 22/02/2018 16:56, Brijesh Singh wrote:
>>
>>
>> On 02/21/2018 02:18 PM, Al Viro wrote:
>>> On Wed, Feb 21, 2018 at 01:59:55PM -0600, Brijesh Singh wrote:
>>>
>>>> Sure, checking access_ok() does not guarantee that later
>>>> copy_from_user() will not fail. But it does eliminate one possible
>>>> reason for the failure. We are trying to validate most of the user
>>>> inputs before we invoke SEV command.
>>>
>>> That makes no sense whatsoever. If user is deliberately fuzzing
>>> your code or trying to DoS it, that "validation" doesn't buy you
>>> anything - they can just as well feed you NULL, after all.
>>>
>>
>>
>> Currently, we let user query the blob length with params.len == 0 ||
>> param.uaddr == NULL. We could limit it to just params.len == 0.
>>
>>
>>> What is the rationale for that? "Userland is accidentally feeding
>>> us garbage pointers" is the case where slowness is the least of your
>>> concerns...
>>>
>>
>> My intent was to do some obvious failure checks on user inputs before
>> invoking the HW. I do see your point that if userspace is feeding us
>> garbage then slowness is least of our concern. If you think that we
>> should not be using access_ok() in this particular case then I am okay
>> with it.
>
> Can you please send a patch? Thanks!
>
Sure, I will send patch soon.
-Brijesh
prev parent reply other threads:[~2018-02-23 18:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=f593be03-4cb1-5569-e8dd-9b1ef6557798@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 \
--cc=viro@ZenIV.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox