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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed,  3 Apr 2013 21:39:44 -0700
From:	Tony Chung <tonychung00@...il.com>
To:	Wim Van Sebroeck <wim@...ana.be>, linux-watchdog@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Tony Chung <tonychung00@...il.com>
Subject: [PATCH v4 2/2] watchdog: fix w83627hf_wdt  clear timeout expired


Observed that the Watchdog Timer Status bit can be set when the driver is
loaded. Reset it during initialization. The time-out value must be set to 0
explicitly in this case to prevent an immediate reset.

Depending on the motherboard and with watchdog disabled in the BIOS, this reset problem can easily be reproduced by the following steps:
1.  reboot the system 
2.  wait for 5+ minutes 
3.  don't start any watchdog server.
4.  just run "modprobe w83627hf_wdt"

If the system load the driver after 5  minutes, it rebooted immediately because of timer expired.  For example, fsck could take more than 5 minutes to run, 
then the computer reboot as soon as the driver was loaded.

Signed-off-by: Tony Chung <tonychung00@...il.com>
---
 drivers/watchdog/w83627hf_wdt.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 8f1111d..7eaa226 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -168,14 +168,16 @@ static void w83627hf_init(void)
 		pr_info("Watchdog already running. Resetting timeout to %d sec\n",
 			wdt_get_timeout_secs(timeout));
 		outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
+	} else {
+		outb_p(0, WDT_EFDR);    /* disable to prevent reboot */
 	}
 
 	w83627hf_setup_crf5();
 
 	outb_p(0xF7, WDT_EFER); /* Select CRF7 */
 	t = inb_p(WDT_EFDR);      /* read CRF7 */
-	t &= ~0xC0;               /* disable keyboard & mouse turning off
-				    watchdog */
+	t &= ~0xD0;               /* clear timeout occurred and disable keyboard
+				     & mouse turning off watchdog */
 	outb_p(t, WDT_EFDR);    /* Write back to CRF7 */
 
 	w83627hf_unselect_wd_register();
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ