Date: Thu, 25 Nov 2004 19:16:41 GMT From: Alex Hoff <ahoff@sandvine.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/74386: Killing watchdogd does not shutdown watchdog Message-ID: <200411251916.iAPJGfqL082949@www.freebsd.org> Resent-Message-ID: <200411251920.iAPJKVCV028502@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 74386 >Category: kern >Synopsis: Killing watchdogd does not shutdown watchdog >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 25 19:20:31 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Alex Hoff >Release: 5.3 RELEASE >Organization: Sandvine Inc >Environment: FreeBSD 5.3 Release >Description: watchdogd when exiting will with remove the WD_ACTIVE flag by calling wd_ioctl with that bit set to 0. This is supposed to disable the watchdog, but since kern_clock.c:watchdog_config does not check to see if the ACTIVE flag is set, it will NEVER hit the "watchdog_enabled = 0;" code. Thus, when you kill watchdogd and stop kicking the watchdog, it will panic. >How-To-Repeat: Load the software watchdog and kill watchdogd. The kernel should panic in ~15 seconds (depending on your timeout). >Fix: Patch: Check to make sure the watchdog is actually active. Also remove duplicate WD_INTERVAL line. --- kern_clock.c 2004-11-25 14:01:59.000000000 -0500 +++ kern_clock.old 2004-11-25 14:01:41.000000000 -0500 @@ -503,7 +503,8 @@ u_int u; u = cmd & WD_INTERVAL; + if ((cmd & WD_ACTIVE) && u >= WD_TO_1SEC) { - if (cmd && u >= WD_TO_1SEC) { - u = cmd & WD_INTERVAL; watchdog_ticks = (1 << (u - WD_TO_1SEC)) * hz; watchdog_enabled = 1; *err = 0; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411251916.iAPJGfqL082949>