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

Re: [libvirt] [PATCH] Fix flaw in thread creation APIs



On 12/01/2010 04:25 AM, Daniel P. Berrange wrote:
> The arguments passed to the thread function must be allocated on
> the heap, rather than the stack, since it is possible for the
> spawning thread to continue before the new thread runs at all.
> In such a case, it is possible that the area of stack where the
> thread args were stored is overwritten.
> 
> * src/util/threads-pthread.c, src/util/threads-win32.c: Allocate
>   thread arguments on the heap
> ---
>  src/util/threads-pthread.c |   15 +++++++++++++--
>  src/util/threads-win32.c   |   17 ++++++++++++++---
>  2 files changed, 27 insertions(+), 5 deletions(-)

ACK.  I'm surprised we haven't noticed it sooner.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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