[Lguest] [PATCH 4/5] lguest: use KVM hypercalls

Eric W. Biederman ebiederm at xmission.com
Wed Apr 15 23:35:58 EST 2009


Herbert Xu <herbert at gondor.apana.org.au> 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



More information about the Lguest mailing list