Re: [PATCH] Watchdog: fix pretimeout noop governor logging and description

[email protected]
Newsgroups org.kernel.vger.linux-watchdog
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch leaves the `%d` format specifier in the `pr_alert` string but removes the corresponding argument.
--

commit 0327e7d6697fa21e6b3ac5f9311da43e2ca86831
Author: Lorenzo Egidio <[email protected]>

Watchdog: fix pretimeout noop governor logging and description

This commit updates the watchdog pretimeout noop governor by removing
the usage of wdd->id to avoid potential compilation issues on different
kernel versions. It also corrects the module description to match the
governor's name.

> diff --git a/drivers/watchdog/pretimeout_noop.c b/drivers/watchdog/pretimeout_noop.c
> index 74ec02b9ffca4..ddb5192fb06bc 100644
> --- a/drivers/watchdog/pretimeout_noop.c
> +++ b/drivers/watchdog/pretimeout_noop.c
> @@ -17,7 +17,7 @@
>   */
>  static void pretimeout_noop(struct watchdog_device *wdd)
>  {
> -	pr_alert("watchdog%d: pretimeout event\n", wdd->id);
> +	pr_alert("watchdog%d: pretimeout event\n");

[Severity: Medium]
Does this leave a format specifier without a corresponding argument? 

The commit message suggested changing the string to 
"watchdog: pretimeout event\n", but the %d is still present in the format 
string. This will likely cause pr_alert() to read an uninitialized integer 
from the stack or a register, resulting in garbage values being printed to 
the kernel log.

>  }
>  
>  static struct watchdog_governor watchdog_gov_noop = {
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.