]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Set the tcb (thread control block) in the child process after a fork.
authorDaniel Eischen <deischen@FreeBSD.org>
Thu, 6 Dec 2007 06:04:01 +0000 (06:04 +0000)
committerDaniel Eischen <deischen@FreeBSD.org>
Thu, 6 Dec 2007 06:04:01 +0000 (06:04 +0000)
commit396a73603d9970f01e5137ec0af852210a495c1e
tree9b67c8f99c5e2e786796a9e1fe1daa2c859b154c
parent208e56cb04f7f7735a764e35b970d7faa7d6731a
Set the tcb (thread control block) in the child process after a fork.
This protects against a race with an upcall in the parent during the
fork which can clobber the parent's tcb before the vm space is copied
in the child.  The child then gets a corrupted tcb that is either null
or that points to another thread that doesn't exist in the child (after
a fork, only the fork()ing thread exists in the child).

Reported by: Arno J. Klaassen (arno at heho / snv / jussieu / fr)
lib/libkse/thread/thr_kern.c