[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101108113853.772b960e@lxorguk.ukuu.org.uk>
Date: Mon, 8 Nov 2010 11:38:53 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: <ilkka.koskinen@...ia.com>
Cc: <linux-input@...r.kernel.org>, <dmitry.torokhov@...il.com>,
<linux-kernel@...r.kernel.org>,
<spi-devel-general@...ts.sourceforge.net>
Subject: Re: [PATCH] input: spi: Driver for SPI data stream driven vibrator
On Mon, 8 Nov 2010 12:08:07 +0100
<ilkka.koskinen@...ia.com> wrote:
> Hi,
>
> >From: ext Alan Cox [mailto:alan@...rguk.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))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists