qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 1/1] audio/jack: fix use after free segfault


From: Gerd Hoffmann
Subject: Re: [PATCH v5 1/1] audio/jack: fix use after free segfault
Date: Thu, 20 Aug 2020 07:37:28 +0200

  Hi,

> > +    qemu_bh_cancel(c->shutdown_bh);
> 
> Looks like a potential race. Quote from the API doc of qemu_bh_cancel():
> 
>       "While cancellation itself is also wait-free and thread-safe, it can of 
>         
>       course race with the loop that executes bottom halves unless you are 
>       holding the iothread mutex.  This makes it mostly useless if you are 
> not 
>       holding the mutex."

Should not be a problem, all auto backend code should only be called
while qemu holds the iothread mutex.  With the exception of the shutdown
handler which jack might call from signal context (which is why we need
the BH in the first place).

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]