From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: [PATCH 4/5] lguest: use KVM hypercalls Date: Wed, 15 Apr 2009 06:35:58 -0700 Message-ID: References: <1239043798.27826.93.camel@zetabook> <200904081021.39877.rusty@rustcorp.com.au> <1239224319.17844.16.camel@zetabook> <49DDE91A.8060603@trash.net> <49DDF614.1060909@trash.net> <49E47976.8020005@trash.net> <20090415083610.GA8579@gondor.apana.org.au> <20090415084717.GA8829@gondor.apana.org.au> <20090415132802.GA11408@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: lguest-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, Christian Borntraeger , "David S. Miller" , virtualization-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, Matias Zabaljauregui , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Patrick McHardy To: Herbert Xu Return-path: In-Reply-To: <20090415132802.GA11408-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org> (Herbert Xu's message of "Wed\, 15 Apr 2009 21\:28\:02 +0800") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lguest-bounces+glkvl-lguest=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: lguest-bounces+glkvl-lguest=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org List-Id: netdev.vger.kernel.org Herbert Xu writes: > On Wed, Apr 15, 2009 at 06:23:29AM -0700, Eric W. Biederman wrote: >> >> There is a GIGANTIC reason to have the wait queue on tfile. >> >> If you open a file, and do ip link del tapN you can still >> be blocked waiting in poll. >> >> The problem is specifically free_poll_entry, where we call >> remove_wait_queue and fput without calling any file methods. >> So all of this happens without struct tun_file's count being >> elevated. Which means tun_net_uninit can detach before we get >> off of the stupid poll wait queue. > > What about taking a netdev refcount before calling poll_wait? Because as far as I can tell we would just leak that refcount. The poll code does not appear to call back into any of the file methods when it frees itself from the wait queue. Eric