mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org, gwendal@chromium.org,
	javier.martinez@collabora.co.uk
Subject: Security hole in cros_ec_dev.c on 32bit chrome hosts
Date: Tue, 1 Mar 2016 20:33:38 +0000	[thread overview]
Message-ID: <20160301203338.360a3487@www.etchedpixels.co.uk> (raw)

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

             reply	other threads:[~2016-03-01 20:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 20:33 Alan Cox [this message]
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

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=20160301203338.360a3487@www.etchedpixels.co.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=gwendal@chromium.org \
    --cc=javier.martinez@collabora.co.uk \
    --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®