From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 25 19:20:32 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4375716A4CE for ; Thu, 25 Nov 2004 19:20:32 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BD2743D54 for ; Thu, 25 Nov 2004 19:20:32 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iAPJKVOf028503 for ; Thu, 25 Nov 2004 19:20:31 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iAPJKVCV028502; Thu, 25 Nov 2004 19:20:31 GMT (envelope-from gnats) Resent-Date: Thu, 25 Nov 2004 19:20:31 GMT Resent-Message-Id: <200411251920.iAPJKVCV028502@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Hoff Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F27D616A4CE for ; Thu, 25 Nov 2004 19:16:41 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF06643D2F for ; Thu, 25 Nov 2004 19:16:41 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iAPJGfGA082950 for ; Thu, 25 Nov 2004 19:16:41 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id iAPJGfqL082949; Thu, 25 Nov 2004 19:16:41 GMT (envelope-from nobody) Message-Id: <200411251916.iAPJGfqL082949@www.freebsd.org> Date: Thu, 25 Nov 2004 19:16:41 GMT From: Alex Hoff To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/74386: Killing watchdogd does not shutdown watchdog X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2004 19:20:32 -0000 >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: