Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Change pr_debug_ratelimited to pass 'fmt' instead of 'pr_fmt(fmt)' 
to avoid masking the true invocation error via an improper variadic sink in 
DEFINE_DYNAMIC_DEBUG_METADATA_CLS.
--

commit 6b20b9b19031937bd627698de6352c6bfec6e4f6
Author: Philipp Hahn <[email protected]>

dyndbg: Ignore additional arguments from pr_fmt

This commit alters the DEFINE_DYNAMIC_DEBUG_METADATA_CLS macro to accept and
discard variadic arguments. This is intended to workaround a build error when
pr_debug_ratelimited is used with a pr_fmt that adds arguments.

> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index d00605ef651ec..82cde8e6b46cb 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -362,7 +362,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
>               dump_stack();                                   \
>  }
>  
> -#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt)    \
> +#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt, ...)       \

[Severity: Medium]
Does taking variadic arguments here mask the underlying invocation error?

By taking '...' and discarding the extra arguments, the metadata descriptor
for pr_debug_ratelimited() incorrectly stores the prefixed format string
(with unresolved format specifiers like "%s"), while pr_debug() stores the
unprefixed format string.

This inconsistency breaks dynamic debug format queries when a module redefines
pr_fmt with multiple arguments.

Should pr_debug_ratelimited() in include/linux/printk.h be changed to pass
'fmt' instead of 'pr_fmt(fmt)' to DEFINE_DYNAMIC_DEBUG_METADATA(), similar
to how dev_dbg_ratelimited() handles it, rather than altering the metadata
macro to silently drop arguments?

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

Reply via email to