Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] dyndbg: UAPI break for boot parameters containing unquoted @
--

commit a948e5ac96c252adcbc1059b7607e6fa7aab2b9d
Author: Jim Cromie <[email protected]>

dyndbg: split multi-query strings with @
    
This commit adds '@' to the existing ';' and '\n' separators for dynamic debug
queries. This provides a more shell-friendly delimiter, reducing the need for
quoting and escaping.

> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index 6482fd28def46..636a88994a774 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c

[ ... ]

> @@ -622,6 +622,30 @@ static int ddebug_exec_query(char *query_string, const 
> char *modname)
>       return nfound;
>  }
>  
> +/*
> + * Split multi-query string on delimiters (@, ;, \n), ignoring delimiters
> + * that appear inside single or double quoted strings.
> + */
> +static char *ddebug_find_delimiter(char *str, const char *delims)
> +{
> +     bool in_quote = false;
> +     char quote_char = 0;
> +
> +     for (; *str; str++) {
> +             if (*str == '"' || *str == '\'') {
> +                     if (!in_quote) {
> +                             in_quote = true;
> +                             quote_char = *str;
> +                     } else if (*str == quote_char) {
> +                             in_quote = false;
> +                     }
> +             } else if (!in_quote && strchr(delims, *str)) {

[Severity: Medium]
Does this cause a regression for boot parameters with an unquoted '@' symbol?

When a user provides a kernel parameter like dyndbg="format i2c@1000 +p",
parse_args() strips the outer double-quotes before passing the unquoted
string down.

Once ddebug_exec_queries() passes the string to ddebug_find_delimiter(), it
will prematurely split the string at the '@' because in_quote is false,
producing invalid queries like 'format i2c' and '1000 +p', both of which
fail to parse.

Could this break existing boot parameters or modprobe configurations that
rely on the '@' symbol in format strings (e.g., matching device tree nodes)?

> +                     return str;
> +             }
> +     }
> +     return NULL;
> +}

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=31

Reply via email to