From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org, Johan Hovold <johan@kernel.org>,
syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com,
stable <stable@vger.kernel.org>, Hansjoerg Lipp <hjlipp@web.de>,
Tilman Schmidt <tilman@imap.cc>
Subject: [PATCH 1/4] staging: gigaset: fix general protection fault on probe
Date: Fri, 29 Nov 2019 11:17:50 +0100 [thread overview]
Message-ID: <20191129101753.9721-2-johan@kernel.org> (raw)
In-Reply-To: <20191129101753.9721-1-johan@kernel.org>
Fix a general protection fault when accessing the endpoint descriptors
which could be triggered by a malicious device due to missing sanity
checks on the number of endpoints.
Reported-by: syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com
Fixes: 07dc1f9f2f80 ("[PATCH] isdn4linux: Siemens Gigaset drivers - M105 USB DECT adapter")
Cc: stable <stable@vger.kernel.org> # 2.6.17
Cc: Hansjoerg Lipp <hjlipp@web.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/staging/isdn/gigaset/usb-gigaset.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/staging/isdn/gigaset/usb-gigaset.c b/drivers/staging/isdn/gigaset/usb-gigaset.c
index 1b9b43659bdf..5e393e7dde45 100644
--- a/drivers/staging/isdn/gigaset/usb-gigaset.c
+++ b/drivers/staging/isdn/gigaset/usb-gigaset.c
@@ -685,6 +685,11 @@ static int gigaset_probe(struct usb_interface *interface,
return -ENODEV;
}
+ if (hostif->desc.bNumEndpoints < 2) {
+ dev_err(&interface->dev, "missing endpoints\n");
+ return -ENODEV;
+ }
+
dev_info(&udev->dev, "%s: Device matched ... !\n", __func__);
/* allocate memory for our device state and initialize it */
--
2.24.0
next prev parent reply other threads:[~2019-11-29 10:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 10:17 [PATCH 0/4] staging: gigaset: fix crashes on probe Johan Hovold
2019-11-29 10:17 ` Johan Hovold [this message]
[not found] ` <20191201001505.964E72075A@mail.kernel.org>
2019-12-01 12:30 ` [PATCH 1/4] staging: gigaset: fix general protection fault " Tilman Schmidt
2019-12-01 12:41 ` Greg Kroah-Hartman
2019-12-01 13:04 ` Johan Hovold
2019-11-29 10:17 ` [PATCH 2/4] staging: gigaset: fix illegal free on probe errors Johan Hovold
2019-11-29 10:17 ` [PATCH 3/4] staging: gigaset: add endpoint-type sanity check Johan Hovold
2019-11-29 10:17 ` [PATCH 4/4] staging: gigaset: rename endpoint-descriptor identifier Johan Hovold
2019-11-29 13:32 ` [PATCH 0/4] staging: gigaset: fix crashes on probe Greg Kroah-Hartman
2019-11-29 13:51 ` Johan Hovold
2019-11-29 14:23 ` Greg Kroah-Hartman
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=20191129101753.9721-2-johan@kernel.org \
--to=johan@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hjlipp@web.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com \
--cc=tilman@imap.cc \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.