From owner-freebsd-bugs@FreeBSD.ORG Thu May 20 14:40:07 2010 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 92AC4106568F for ; Thu, 20 May 2010 14:40:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 553B88FC29 for ; Thu, 20 May 2010 14:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4KEe7YQ009318 for ; Thu, 20 May 2010 14:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4KEe76f009316; Thu, 20 May 2010 14:40:07 GMT (envelope-from gnats) Resent-Date: Thu, 20 May 2010 14:40:07 GMT Resent-Message-Id: <201005201440.o4KEe76f009316@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, Andrew Boyer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48A11065686 for ; Thu, 20 May 2010 14:36:58 +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 B33838FC2E for ; Thu, 20 May 2010 14:36:58 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o4KEawei077137 for ; Thu, 20 May 2010 14:36:58 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o4KEaw9T077136; Thu, 20 May 2010 14:36:58 GMT (envelope-from nobody) Message-Id: <201005201436.o4KEaw9T077136@www.freebsd.org> Date: Thu, 20 May 2010 14:36:58 GMT From: Andrew Boyer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/146759: cxgb panic calling without cxgb_set_lro() without port lock held 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, 20 May 2010 14:40:07 -0000 >Number: 146759 >Category: kern >Synopsis: cxgb panic calling without cxgb_set_lro() without port lock held >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 20 14:40:07 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Andrew Boyer >Release: RELENG_7 >Organization: Avere Systems >Environment: FreeBSD armada2 7.1-RELEASE-p3 FreeBSD 7.1-RELEASE-p3 #140: Wed May 19 16:52:20 EDT 2010 root@XXX:/usr/home/aboyer/src/freebsd/src/sys/amd64/compile/DEBUG amd64 >Description: The cxgb driver causes a kernel panic if you try to disable LRO; it asserts that the port lock is held when there is no way that it could be. This problem appears to have existed for a long time (SVN 181616, Aug 2008?). We must be the only people disabling LRO. >How-To-Repeat: 'ifconfig cxgb0 -lro' >Fix: Take the port lock before calling cxgb_set_lro() in src/sys/dev/cxgb/cxgb_main.c. diff -u cxgb_main.c cxgb_main_upd.c --- cxgb_main.c 2010-05-20 10:24:49.000000000 -0400 +++ cxgb_main_upd.c 2010-05-20 10:26:22.000000000 -0400 @@ -2106,8 +2106,10 @@ if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; + PORT_LOCK(p); /* Safe to do this even if cxgb_up not called yet */ cxgb_set_lro(p, ifp->if_capenable & IFCAP_LRO); + PORT_UNLOCK(p); } if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; >Release-Note: >Audit-Trail: >Unformatted: