lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 21 Apr 2022 22:50:29 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     liuxp11 <liuxp11@...natelecom.cn>, wim <wim@...ux-watchdog.org>
Cc:     linux-watchdog <linux-watchdog@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Watchdog: Checking timeout invalid if hardware heartbeat
 range is configured

On 4/21/22 16:31, liuxp11 wrote:
>  > diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
> 
>      > index 195c8c004b69..d166d33ce7ae 100644
>      > --- a/drivers/watchdog/wdat_wdt.c
>      > +++ b/drivers/watchdog/wdat_wdt.c
>      > @@ -450,8 +450,7 @@ static int wdat_wdt_probe(struct platform_device *pdev)
>      >        * watchdog properly after it has opened the device. In some cases
>      >        * the BIOS default is too short and causes immediate reboot.
>      >        */
>      > -    if (timeout * 1000 < wdat->wdd.min_hw_heartbeat_ms ||
>      > -        timeout * 1000 > wdat->wdd.max_hw_heartbeat_ms) {
>      > +    if (watchdog_timeout_invalid(&wdat->wdd, timeout)) {
>      >           dev_warn(dev, "Invalid timeout %d given, using %d\n",
>      >                timeout, WDAT_DEFAULT_TIMEOUT);
>      >           timeout = WDAT_DEFAULT_TIMEOUT;
>     Thanks your reply, read these code,thinking can put them into watchdog_timeout_invalid.


Again, no. If anything the above code is wrong; there should be no
upper limit if max_hw_heartbeat_ms is provided. The code should
probably set min_timeout and just call watchdog_timeout_invalid()
without any change in that function.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ