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>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 30 Jun 2023 13:39:12 +0800
From:   Meng Li <Meng.Li@...driver.com>
To:     wim@...ux-watchdog.org, linux@...ck-us.net,
        linux-watchdog@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, meng.li@...driver.com
Subject: [PATCH] watchdog: core: stop watchdog when executing poweroff command

From: Meng Li <meng.li@...driver.com>

On some platforms, for example, Intel SoC FPGA platform, the watchdog is
started in from u-boot, and so kernel will create a timer and work to
keep watchdog alive. .But when user executes commands "poweroff" or
"shutdown -h", the system is reset when watchdog triggers timeout even
if WDOG_STOP_ON_REBOOT is set in watchdog driver. The root cause is
that the watchdog not stopped properly because the SYS_POWER_OFF case
is not supported in nofify callback function. So, add this case to stop
watchdog when executing poweroff command.

Signed-off-by: Meng Li <Meng.Li@...driver.com>
---
 drivers/watchdog/watchdog_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index d4c5a736fdcb..5b55ccae06d4 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -161,7 +161,7 @@ static int watchdog_reboot_notifier(struct notifier_block *nb,
 	struct watchdog_device *wdd;
 
 	wdd = container_of(nb, struct watchdog_device, reboot_nb);
-	if (code == SYS_DOWN || code == SYS_HALT) {
+	if (code == SYS_DOWN || code == SYS_HALT || code == SYS_POWER_OFF) {
 		if (watchdog_hw_running(wdd)) {
 			int ret;
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ