From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Cameron Gutman <aicommander@gmail.com>
Cc: linux-input <linux-input@vger.kernel.org>
Subject: Re: [PATCH] Input: xpad - validate USB endpoint count during probe
Date: Wed, 29 Jun 2016 10:08:06 -0700 [thread overview]
Message-ID: <20160629170806.GA35304@dtor-ws> (raw)
In-Reply-To: <577362E7.2000508@gmail.com>
On Wed, Jun 29, 2016 at 12:55:51AM -0500, Cameron Gutman wrote:
> This prevents a malicious USB device from causing an oops.
>
> Signed-off-by: Cameron Gutman <aicommander@gmail.com>
> Cc: stable@vger.kernel.org
> ---
Applied, thank you.
> drivers/input/joystick/xpad.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 3438e98..a529a45 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -1431,6 +1431,9 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
> int ep_irq_in_idx;
> int i, error;
>
> + if (intf->cur_altsetting->desc.bNumEndpoints != 2)
> + return -ENODEV;
> +
> for (i = 0; xpad_device[i].idVendor; i++) {
> if ((le16_to_cpu(udev->descriptor.idVendor) == xpad_device[i].idVendor) &&
> (le16_to_cpu(udev->descriptor.idProduct) == xpad_device[i].idProduct))
> --
> 2.7.4
--
Dmitry
prev parent reply other threads:[~2016-06-29 17:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 5:55 [PATCH] Input: xpad - validate USB endpoint count during probe Cameron Gutman
2016-06-29 17:08 ` Dmitry Torokhov [this message]
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=20160629170806.GA35304@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=aicommander@gmail.com \
--cc=linux-input@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;
as well as URLs for NNTP newsgroup(s).