linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Security hole in cros_ec_dev.c on 32bit chrome hosts
@ 2016-03-01 20:33 Alan Cox
  2016-03-03  5:58 ` [PATCH] platform/chrome: cros_ec_dev - Fix security issue Gwendal Grignou
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2016-03-01 20:33 UTC (permalink / raw)
  To: linux-kernel, gwendal, javier.martinez

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-05-11 19:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 20:33 Security hole in cros_ec_dev.c on 32bit chrome hosts Alan Cox
2016-03-03  5:58 ` [PATCH] platform/chrome: cros_ec_dev - Fix security issue Gwendal Grignou
2016-03-03 18:35   ` Randy Dunlap
2016-03-03 19:00     ` [PATCH v2] " Gwendal Grignou
2016-03-06 20:11       ` Olof Johansson
2016-03-08 17:02         ` Gwendal Grignou
2016-03-08 17:13           ` [PATCH v3] " Gwendal Grignou
2016-05-11 17:58             ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).