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

Eric Blake eblake at redhat.com
Wed Dec 1 16:07:13 UTC 2010


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 at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101201/b48f7a3c/attachment-0001.sig>


More information about the libvir-list mailing list