All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Defang Bo <bodefang@126.com>
Cc: jason.wessel@windriver.com, dianders@chromium.org, arnd@arndb.de,
	gregkh@linuxfoundation.org, kgdb-bugreport@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kgdbts: Passing ekgdbts to command line causes panic
Date: Mon, 4 Jan 2021 11:28:54 +0000	[thread overview]
Message-ID: <20210104112854.fghr32y37mzw6fpb@holly.lan> (raw)
In-Reply-To: <1609120738-202321-1-git-send-email-bodefang@126.com>

On Mon, Dec 28, 2020 at 09:58:58AM +0800, Defang Bo wrote:
> Similar to commit<1bd54d851f50>("kgdboc: Passing ekgdboc to command line causes panic"),
> kgdbts_option_setup does not check input argument before passing it to strlen.
> The argument would be a NULL pointer.

Something seems to be missing here.

The ekgdbts parameter mentioned in the subject line doesn't exist so
how can including it on the kernel command line could provoke a panic.

Please can you share the kernel boot arguments you used when you tested
this patch?


Daniel.


> 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..b077547 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
> 

  reply	other threads:[~2021-01-04 11:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28  1:58 [PATCH] kgdbts: Passing ekgdbts to command line causes panic Defang Bo
2021-01-04 11:28 ` Daniel Thompson [this message]
     [not found]   ` <279df92c.1b26.176d0907b64.Coremail.bodefang@126.com>
2021-01-05 12:10     ` Daniel Thompson
2021-01-05 14:01 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2020-12-28  1:54 Defang Bo
2020-12-27 13:43 Defang Bo
2020-12-27 15: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=20210104112854.fghr32y37mzw6fpb@holly.lan \
    --to=daniel.thompson@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bodefang@126.com \
    --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 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.