From owner-freebsd-current@FreeBSD.ORG Wed Apr 5 08:44:55 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C10E16A400 for ; Wed, 5 Apr 2006 08:44:55 +0000 (UTC) (envelope-from mistry.7@osu.edu) Received: from mail.united-ware.com (am-productions.biz [69.61.164.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DD3743D46 for ; Wed, 5 Apr 2006 08:44:54 +0000 (GMT) (envelope-from mistry.7@osu.edu) Received: from [192.168.1.100] (am-productions.biz [69.61.164.22]) (authenticated bits=0) by mail.united-ware.com (8.13.4/8.13.4) with ESMTP id k35900PJ022362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 5 Apr 2006 05:00:06 -0400 (EDT) (envelope-from mistry.7@osu.edu) From: Anish Mistry To: freebsd-current@freebsd.org Date: Wed, 5 Apr 2006 04:44:51 -0400 User-Agent: KMail/1.9.1 References: <200604050354.19659.mistry.7@osu.edu> In-Reply-To: <200604050354.19659.mistry.7@osu.edu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3010816.88CGtNQh18"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200604050444.51670.mistry.7@osu.edu> X-Spam-Status: No, score=-8.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYFREEBSD2 autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on mail.united-ware.com X-Virus-Scanned: ClamAV 0.88/1376/Wed Apr 5 01:51:25 2006 on mail.united-ware.com X-Virus-Status: Clean Subject: Re: [PATCH] ugen detach race X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2006 08:44:55 -0000 --nextPart3010816.88CGtNQh18 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 April 2006 03:53, Anish Mistry wrote: > While working on getting hplip ported I ran across a race > condition in the ugen code that causes a crash. The following > patch fixes a problem where read, write, and ioctl can be called > during a detach since sc_dying isn't checked before bumping the > reference count. This puts the sc_dying check before the *_do_* > functions are called. This includes the patch from usb/81308 to > prevent polling on the control endpoint. As well as a few NULL > pointer checks from NetBSD. This patch is applicable to RELENG_6. And CURRENT. > http://am-productions.biz/docs/ugen-detach-race.patch > > This doesn't fix the case where an application has a read/write > pending and then detach is called. In this case destroy_devl will > just keep looping until the read/write completes. =2D-=20 Anish Mistry --nextPart3010816.88CGtNQh18 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQBEM4ODxqA5ziudZT0RAu9UAJ94AfM2fkvSbL9Eh8q0G5488caJOACfbLyn T2TqceWKJtOy5AFDI3+s5ys= =q5+p -----END PGP SIGNATURE----- --nextPart3010816.88CGtNQh18--