From owner-svn-src-all@FreeBSD.ORG Fri Jun 14 18:11:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF148E20; Fri, 14 Jun 2013 18:11:21 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0F0410A6; Fri, 14 Jun 2013 18:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5EIBLjD020523; Fri, 14 Jun 2013 18:11:21 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5EIBLUh020522; Fri, 14 Jun 2013 18:11:21 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201306141811.r5EIBLUh020522@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 14 Jun 2013 18:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251752 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 18:11:22 -0000 Author: lstewart Date: Fri Jun 14 18:11:21 2013 New Revision: 251752 URL: http://svnweb.freebsd.org/changeset/base/251752 Log: Fix a major oversight in r251732 which causes non-VIMAGE kernels to trigger a KASSERT during TCP hhook registration at boot. Virtualised hook points only require extra housekeeping and sanity checking when "options VIMAGE" is present. Reported by: bdrewery,jh,dhw Tested by: dhw MFC after: 1 week X-MFC with: 251732 Modified: head/sys/kern/kern_hhook.c Modified: head/sys/kern/kern_hhook.c ============================================================================== --- head/sys/kern/kern_hhook.c Fri Jun 14 17:00:58 2013 (r251751) +++ head/sys/kern/kern_hhook.c Fri Jun 14 18:11:21 2013 (r251752) @@ -267,9 +267,11 @@ hhook_head_register(int32_t hhook_type, HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { tmphhh->hhh_flags |= HHH_ISINVNET; +#ifdef VIMAGE KASSERT(curvnet != NULL, ("curvnet is NULL")); tmphhh->hhh_vid = (uintptr_t)curvnet; LIST_INSERT_HEAD(&V_hhook_vhead_list, tmphhh, hhh_vnext); +#endif } LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); HHHLIST_UNLOCK(); @@ -285,8 +287,10 @@ hhook_head_destroy(struct hhook_head *hh HHHLIST_LOCK_ASSERT(); LIST_REMOVE(hhh, hhh_next); +#ifdef VIMAGE if (hhook_head_is_virtualised(hhh) == HHOOK_HEADISINVNET) LIST_REMOVE(hhh, hhh_vnext); +#endif HHH_WLOCK(hhh); STAILQ_FOREACH_SAFE(tmp, &hhh->hhh_hooks, hhk_next, tmp2) free(tmp, M_HHOOK); @@ -347,12 +351,14 @@ hhook_head_get(int32_t hhook_type, int32 HHHLIST_LOCK(); LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) { +#ifdef VIMAGE if (hhook_head_is_virtualised(hhh) == HHOOK_HEADISINVNET) { KASSERT(curvnet != NULL, ("curvnet is NULL")); if (hhh->hhh_vid != (uintptr_t)curvnet) continue; } +#endif refcount_acquire(&hhh->hhh_refcount); break; }