I use static analysis tool to find these funcs are similar to the 
commit<1bd54d851f50>(kgdboc: Passing ekgdboc to command line causes panic),
so it's just defensive, I haven't actually hitted this but there actually seems 
a problem here.







At 2021-01-04 19:28:54, "Daniel Thompson" <daniel.thomp...@linaro.org> wrote:
>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 <bodef...@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
>> 

_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to