]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
thread_create(): call cpu_copy_thread() after td_pflags is zeroed
authorKonstantin Belousov <kib@FreeBSD.org>
Sun, 7 Aug 2022 17:00:02 +0000 (20:00 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 8 Aug 2022 16:44:17 +0000 (19:44 +0300)
commit1b0a4974c5004216daf4a2ac4375074ce56bc55b
tree6df03c87f6ab6f7877969b3dc6f16dcc7b343579
parent28b64169eace3477abbd50c18163d37c45cf273a
thread_create(): call cpu_copy_thread() after td_pflags is zeroed

By calling the function too early we might still have the td_pflags
value cached from the previous struct thread use. cpu_copy_thread()
depends on correct value for TDP_KTHREAD at least on x86.

Reported, bisected, and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36069
sys/compat/linux/linux_fork.c
sys/kern/kern_thr.c