From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 11 20:50:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8E8C10656A9 for ; Thu, 11 Jun 2009 20:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 98CC08FC1E for ; Thu, 11 Jun 2009 20:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BKo1i5041080 for ; Thu, 11 Jun 2009 20:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5BKo1GM041079; Thu, 11 Jun 2009 20:50:01 GMT (envelope-from gnats) Resent-Date: Thu, 11 Jun 2009 20:50:01 GMT Resent-Message-Id: <200906112050.n5BKo1GM041079@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, Nima Misaghian Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65D221065673 for ; Thu, 11 Jun 2009 20:49:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 536B58FC12 for ; Thu, 11 Jun 2009 20:49:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BKn9Sw093034 for ; Thu, 11 Jun 2009 20:49:09 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n5BKn9qa093033; Thu, 11 Jun 2009 20:49:09 GMT (envelope-from nobody) Message-Id: <200906112049.n5BKn9qa093033@www.freebsd.org> Date: Thu, 11 Jun 2009 20:49:09 GMT From: Nima Misaghian To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/135485: During a shutdown, kernel modules should be unloaded in reverse order in which they where loaded X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 20:50:05 -0000 >Number: 135485 >Category: kern >Synopsis: During a shutdown, kernel modules should be unloaded in reverse order in which they where loaded >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 11 20:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Nima Misaghian >Release: 6.1 >Organization: Sandvine >Environment: >Description: During a shutdown, kernel modules should be unloaded in reverse order in which they where loaded. Otherwise, modules that other modules depend on are unloaded first, which could cause problems. >How-To-Repeat: >Fix: src/sys/kern/kern_module.c < typedef TAILQ_HEAD(modulelist, module) modulelist_t; > typedef TAILQ_HEAD(, module) modulelist_t; static void module_shutdown(void *arg1, int arg2) { module_t mod; if (arg2 & RB_NOSYNC) return; MOD_SLOCK; < TAILQ_FOREACH_REVERSE(mod, &modules, modulelist, link) > TAILQ_FOREACH(mod, &modules, link) MOD_EVENT(mod, MOD_SHUTDOWN); MOD_SUNLOCK; } >Release-Note: >Audit-Trail: >Unformatted: