lkml.org 
[lkml]   [2016]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectSecurity hole in cros_ec_dev.c on 32bit chrome hosts
This was reported to Google on Feb 2nd with no action but an
acknowledgement.

Making public since so as we are close to release


/* Ioctls */
static long ec_device_ioctl_xcmd(struct cros_ec_dev *ec, void __user *arg)
{
long ret;
struct cros_ec_command u_cmd;
struct cros_ec_command *s_cmd;

if (copy_from_user(&u_cmd, arg, sizeof(u_cmd)))
return -EFAULT;

s_cmd = kmalloc(sizeof(*s_cmd) + max(u_cmd.outsize, u_cmd.insize),
GFP_KERNEL);

Pass u_cmd.insize as a very large value so that it overflows with the
sizeof to a small number which we kmalloc

if (!s_cmd)
return -ENOMEM;

and copy u_cmd.outsize bytes into it.

if (copy_from_user(s_cmd, arg, sizeof(*s_cmd) + u_cmd.outsize)) {
ret = -EFAULT;
goto exit;
}


Alan

\
 
 \ /
  Last update: 2016-03-01 22:01    [W:0.082 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site