From owner-cvs-src@FreeBSD.ORG Tue Aug 12 14:41:56 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 858E01065695; Tue, 12 Aug 2008 14:41:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id C9BD38FC2B; Tue, 12 Aug 2008 14:41:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m7CEfYrb093530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Aug 2008 17:41:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m7CEfYW9084200; Tue, 12 Aug 2008 17:41:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m7CEfY9T084198; Tue, 12 Aug 2008 17:41:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 Aug 2008 17:41:34 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20080812144134.GC1803@deviant.kiev.zoral.com.ua> References: <200808081343.m78DhwYE068477@repoman.freebsd.org> <200808081226.32089.jhb@freebsd.org> <20080809130929.P77335@delplex.bde.org> <200808091555.25020.jhb@freebsd.org> <20080812014937.E21092@besplex.bde.org> <20080812231130.D760@besplex.bde.org> <20080812141521.GX99951@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VywGB/WGlW4DM4P8" Content-Disposition: inline In-Reply-To: <20080812141521.GX99951@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: cvs-src@freebsd.org, cvs-all@freebsd.org, src-committers@freebsd.org, John Baldwin , Bruce Evans Subject: Re: cvs commit: src/sys/dev/io iodev.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 14:41:56 -0000 --VywGB/WGlW4DM4P8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 12, 2008 at 04:15:21PM +0200, Ed Schouten wrote: > Hello all, >=20 > * Bruce Evans wrote: > > I checked that bpf panics (even under UP) due to the obvious bugs in > > its d_close(): > > > > # Generate lots of network activity using something like: > > sysctl net.inet.icmp.icmplim=3D0; ping -fq localhost & > > > > # Race to panic eventually: > > while :; do tcpdump -i lo0 & sleep 0.001; revoke /dev/bpf0 > > > > Most or all device drivers have obvious bugs in their d_close(); bpf > > is just a bit easier to understand and more likely to cause a panic > > than most device drivers, since it is simple and frees resources. A > > panic is very likely when si_drv1 is freed, and si_drv1 is only locked > > accidentally. >=20 > I remember I once warned people about this on the lists. It seems the > cdevpriv API is protected against this, so the following patch turns BPF > into a single device node, which can handle revoke() calls properly. >=20 > I wrote this patch a month ago, but eventually I didn't commit this. I > think I should, though. >=20 > http://80386.nl/files/bpf-cdevpriv.diff Did you tested cdevpriv'ed bpf against revoke ?=20 --VywGB/WGlW4DM4P8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkihoR4ACgkQC3+MBN1Mb4hUkgCgvcyvZcaq22HKyvj145/tD5KU P4QAoIDjgU0ONMB7gZPnDIXGLOWZJfVc =Ci6V -----END PGP SIGNATURE----- --VywGB/WGlW4DM4P8--