mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virt: vbox: Only copy_from_user the request-header once
Date: Tue, 8 May 2018 16:52:50 +0200	[thread overview]
Message-ID: <4f440336-608a-33a8-108a-8c53665a103a@redhat.com> (raw)
In-Reply-To: <20180508142117.GB10972@kroah.com>

Hi,

On 08-05-18 16:21, Greg Kroah-Hartman wrote:
> On Tue, May 08, 2018 at 03:46:59PM +0200, Hans de Goede wrote:
>> In vbg_misc_device_ioctl(), the header of the ioctl argument is copied from
>> the userspace pointer 'arg' and saved to the kernel object 'hdr'. Then the
>> 'version', 'size_in', and 'size_out' fields of 'hdr' are verified.
>>
>> Before this commit, after the checks a buffer for the entire request would
>> be allocated and then all data including the verified header would be
>> copied from the userspace 'arg' pointer again.
>>
>> Given that the 'arg' pointer resides in userspace, a malicious userspace
>> process can race to change the data pointed to by 'arg' between the two
>> copies. By doing so, the user can bypass the verifications on the ioctl
>> argument.
>>
>> This commit fixes this by using the already checked copy of the header
>> to fill the header part of the allocated buffer and only copying the
>> remainder of the data from userspace.
>>
>> Reported-by: Wenwen Wang <wang6495@umn.edu>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Does this need to go into 4.17-final?  Any older kernels?  Or can it
> wait for 4.18-rc1?

I believe this can wait for 4.18-rc1.

Regards,

Hans

      reply	other threads:[~2018-05-08 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 13:46 Hans de Goede
2018-05-08 14:07 ` Hans de Goede
2018-05-08 14:21 ` Greg Kroah-Hartman
2018-05-08 14:52   ` Hans de Goede [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=4f440336-608a-33a8-108a-8c53665a103a@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®