From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Max S." <max@schneidersoft.net>
Cc: Matthias Fuchs <matthias.fuchs@esd.eu>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH] net: can: esd_usb2: check index of array before accessing
Date: Wed, 03 Jul 2013 13:51:12 +0200 [thread overview]
Message-ID: <51D41030.10708@pengutronix.de> (raw)
In-Reply-To: <1372852299.15632.13.camel@blackbox>
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]
On 07/03/2013 01:51 PM, Max S. wrote:
> On Wed, 2013-07-03 at 12:00 +0200, Matthias Fuchs wrote:
>> Hi,
>>
>> did anybody encounter an issue with invalid net codes comming from the
>> device?
> Technically one could write a usb device that sends a bad
> netcode/crafted message.
>
> through
> esd_usb2_read_bulk_callback()
> esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg);
> ...
> esd_usb2_rx_event()
> ...
> u8 state = msg->msg.rx.data[0];
> ...
> priv->old_state = state;
>
> one could write any u8 memory value to <255 past dev->nets.
>
> ... I think.
Yes or crash the kernel by accessing bad memory, better safe then sorry.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
next prev parent reply other threads:[~2013-07-03 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 8:33 [PATCH] net: can: esd_usb2: check index of array before accessing Marc Kleine-Budde
2013-07-03 10:00 ` Matthias Fuchs
2013-07-03 10:04 ` Marc Kleine-Budde
2013-07-03 11:51 ` Max S.
2013-07-03 11:51 ` Marc Kleine-Budde [this message]
[not found] ` <51D41E53.2030900@esd.eu>
2013-07-03 13:04 ` Marc Kleine-Budde
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=51D41030.10708@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=matthias.fuchs@esd.eu \
--cc=max@schneidersoft.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