From owner-cvs-src-old@FreeBSD.ORG Wed Apr 6 21:25:07 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70627106564A for ; Wed, 6 Apr 2011 21:25:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 571B28FC08 for ; Wed, 6 Apr 2011 21:25:07 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p36LP7OO010873 for ; Wed, 6 Apr 2011 21:25:07 GMT (envelope-from glebius@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p36LP7Ps010872 for cvs-src-old@freebsd.org; Wed, 6 Apr 2011 21:25:07 GMT (envelope-from glebius@repoman.freebsd.org) Message-Id: <201104062125.p36LP7Ps010872@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to glebius@repoman.freebsd.org using -f From: Gleb Smirnoff Date: Wed, 6 Apr 2011 18:03:49 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_8 Subject: cvs commit: src/sys/net if.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 21:25:07 -0000 glebius 2011-04-06 18:03:49 UTC FreeBSD src repository Modified files: (Branch: RELENG_8) sys/net if.c Log: SVN rev 220397 on 2011-04-06 18:03:49Z by glebius MFhead 220317: When removing ifnets, we should first remove the reference to ifnet from the interface index, then decrease refcount, not vice versa. Otherwise there is a race (reproducible) when if_free_internal() contests on IFNET_WLOCK(), and we got a zero-refed ifnet in the index for a long time. It may be picked by some other thread, that runs ifnet_byindex_ref(), who takes the ifnet from index, and bumps refcount. When reader drops the lock, if_free_internal() proceeds with free. Then reader tries to free it a second time. Revision Changes Path 1.359.2.30 +10 -9 src/sys/net/if.c