mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: <ilkka.koskinen@nokia.com>
Cc: <linux-input@vger.kernel.org>, <dmitry.torokhov@gmail.com>,
	<linux-kernel@vger.kernel.org>,
	<spi-devel-general@lists.sourceforge.net>
Subject: Re: [PATCH] input: spi: Driver for SPI data stream driven vibrator
Date: Mon, 8 Nov 2010 11:38:53 +0000	[thread overview]
Message-ID: <20101108113853.772b960e@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <F80267346F10C541946CBE8909F1C39E36817A8845@NOK-EUMSG-02.mgdnok.nokia.com>

On Mon, 8 Nov 2010 12:08:07 +0100
<ilkka.koskinen@nokia.com> wrote:

> Hi,
> 
> >From: ext Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
> >Sent: 08 November, 2010 01:52
> >
> >> +	datalen = p->custom_len * sizeof(p->custom_data[0]);
> >
> >signed
> >
> >> +	if (datalen > MAX_EFFECT_SIZE) {
> >
> >unsigned
> 
> It should be unsigned. I'll fix it.
> 
> >> +	memcpy(einfo->buf, p->custom_data, datalen);
> >
> >ungood
> 
> Yep, that's clearly wrong too. Should be copy_from_user() I suppose.

That I hadn't considered - and I'm not sure whether the caller is passed
a kernel copy or not. The problem I was looking at was just the signed
case

	datalen < 0
	if (datalen > MAX ..)
		Nope

	memcpy(kernel, mysource, vastly more than intended (unsigned))


  reply	other threads:[~2010-11-08 11:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 13:31 Ilkka Koskinen
2010-10-26 11:13 ` Grant Likely
2010-10-26 11:17   ` Alan Cox
2010-10-26 16:52     ` ilkka.koskinen
2010-10-26 16:50   ` ilkka.koskinen
2010-10-27  8:47     ` Grant Likely
2010-10-27  8:58       ` Dmitry Torokhov
2010-10-27  9:19     ` Alan Cox
2010-10-26 16:09 ` Dmitry Torokhov
2010-10-27 12:55   ` ilkka.koskinen
2010-11-07 23:51 ` Alan Cox
2010-11-08 11:08   ` ilkka.koskinen
2010-11-08 11:38     ` Alan Cox [this message]
2010-11-08 12:18       ` ilkka.koskinen

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=20101108113853.772b960e@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ilkka.koskinen@nokia.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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®