From: Defang Bo <bodefang@126.com>
To: jason.wessel@windriver.com, daniel.thompson@linaro.org, arnd@arndb.de
Cc: dianders@chromium.org, gregkh@linuxfoundation.org,
kgdb-bugreport@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Defang Bo <bodefang@126.com>
Subject: [PATCH] kgdbts: Passing ekgdbts to command line causes panic
Date: Sun, 27 Dec 2020 21:43:05 +0800 [thread overview]
Message-ID: <1609076585-4010725-1-git-send-email-bodefang@126.com> (raw)
Similar to commit<1bd54d85>,kgdbts_option_setup does not check input argument
before passing it to strlen. The argument would be a NULL pointer.
Signed-off-by: Defang Bo <bodefang@126.com>
---
drivers/misc/kgdbts.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
index 945701b..99d9795 100644
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -1057,6 +1057,11 @@ static void kgdbts_run_tests(void)
static int kgdbts_option_setup(char *opt)
{
+ if (!opt) {
+ pr_err("kgdbts: config string not provided\n");
+ return -EINVAL;
+ }
+
if (strlen(opt) >= MAX_CONFIG_LEN) {
printk(KERN_ERR "kgdbts: config string too long\n");
return -ENOSPC;
--
2.7.4
next reply other threads:[~2020-12-27 13:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-27 13:43 Defang Bo [this message]
2020-12-27 15:01 ` Greg KH
2020-12-28 1:54 Defang Bo
2020-12-28 1:58 Defang Bo
2021-01-04 11:28 ` Daniel Thompson
[not found] ` <279df92c.1b26.176d0907b64.Coremail.bodefang@126.com>
2021-01-05 12:10 ` Daniel Thompson
2021-01-05 14:01 ` Greg KH
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=1609076585-4010725-1-git-send-email-bodefang@126.com \
--to=bodefang@126.com \
--cc=arnd@arndb.de \
--cc=daniel.thompson@linaro.org \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®