lkml.org 
[lkml]   [2021]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 186/190] Revert "virt: vbox: Only copy_from_user the request-header once"
Date
On 2021-04-21, Greg Kroah-Hartman wrote:
> This reverts commit bd23a7269834dc7c1f93e83535d16ebc44b75eba.
>
> - *((struct vbg_ioctl_hdr *)buf) = hdr;
> - if (copy_from_user(buf + sizeof(hdr), (void *)arg + sizeof(hdr),
> - hdr.size_in - sizeof(hdr))) {
> + if (copy_from_user(buf, (void *)arg, hdr.size_in)) {
> ret = -EFAULT;
> goto out;
> }

This one seems like a real bugfix, otherwise there's a double-fetch from
userspace, and a TOCTOU with the hdr fields that could cause a OOB read.

Reviewed-by: Tavis Ormandy <taviso@gmail.com>

Tavis.


--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger taviso@sdf.org
_\_V _( ) _( ) @taviso

\
 
 \ /
  Last update: 2021-04-21 17:20    [W:1.167 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site