From: "Tobin C. Harding" <me@tobin.cc>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Tobin C. Harding" <me@tobin.cc>,
kernel-hardening@lists.openwall.com,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Tycho Andersen <tycho@tycho.ws>,
Kees Cook <keescook@chromium.org>,
Felipe Balbi <felipe.balbi@linux.intel.com>,
Alan Stern <stern@rowland.harvard.edu>
Subject: [3/4] usb: Remove stack VLA usage
Date: Fri, 9 Mar 2018 16:55:35 +1100 [thread overview]
Message-ID: <1520574935-7457-1-git-send-email-me@tobin.cc> (raw)
Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
drivers/usb/misc/usbtest.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 90028ef541e3..9e1142b8b91b 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -2028,11 +2028,14 @@ test_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param,
unsigned i;
unsigned long packets = 0;
int status = 0;
- struct urb *urbs[param->sglen];
+ struct urb *urbs[MAX_SGLEN];
if (!param->sglen || param->iterations > UINT_MAX / param->sglen)
return -EINVAL;
+ if (param->sglen > MAX_SGLEN)
+ return -EINVAL;
+
memset(&context, 0, sizeof(context));
context.count = param->iterations * param->sglen;
context.dev = dev;
next reply other threads:[~2018-03-09 5:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 5:55 Tobin C. Harding [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-03-09 6:05 [3/4] usb: Remove stack VLA usage Tobin C. Harding
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=1520574935-7457-1-git-send-email-me@tobin.cc \
--to=me@tobin.cc \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=tycho@tycho.ws \
/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).