From owner-svn-src-head@FreeBSD.ORG Sun Sep 13 21:30:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 242991065672; Sun, 13 Sep 2009 21:30:19 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1320A8FC13; Sun, 13 Sep 2009 21:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DLUI2v032216; Sun, 13 Sep 2009 21:30:18 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DLUIjG032215; Sun, 13 Sep 2009 21:30:18 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200909132130.n8DLUIjG032215@svn.freebsd.org> From: Marko Zec Date: Sun, 13 Sep 2009 21:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197176 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 21:30:19 -0000 Author: zec Date: Sun Sep 13 21:30:18 2009 New Revision: 197176 URL: http://svn.freebsd.org/changeset/base/197176 Log: Lock the ifnet list while iterating over it. Submitted by: julian MFC after: 3 days Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sun Sep 13 20:19:02 2009 (r197175) +++ head/sys/compat/linux/linux_ioctl.c Sun Sep 13 21:30:18 2009 (r197176) @@ -2152,6 +2152,7 @@ linux_ifconf(struct thread *td, struct i /* handle the 'request buffer size' case */ if (ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; + IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2159,6 +2160,7 @@ linux_ifconf(struct thread *td, struct i ifc.ifc_len += sizeof(ifr); } } + IFNET_RUNLOCK(); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); return (error);