summaryrefslogtreecommitdiff
path: root/drivers/w1/masters/mxc_w1.c
diff options
context:
space:
mode:
authorWenwen Wang <wang6495@umn.edu>2018-05-08 16:50:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-14 17:31:59 +0300
commitbd23a7269834dc7c1f93e83535d16ebc44b75eba (patch)
treefbe0ee7fc57f701893a74c94afb8de879a2ca0ad /drivers/w1/masters/mxc_w1.c
parentbdeeed098811b36d1f988521600a89a400830a4b (diff)
downloadlinux-bd23a7269834dc7c1f93e83535d16ebc44b75eba.tar.xz
virt: vbox: Only copy_from_user the request-header once
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. Signed-off-by: Wenwen Wang <wang6495@umn.edu> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1/masters/mxc_w1.c')
0 files changed, 0 insertions, 0 deletions