Re: [PATCH] Fix flaw in thread creation APIs

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

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]