Page MenuHomeFreeBSD

thread_create(): call cpu_copy_thread() after td_pflags is zeroed
ClosedPublic

Authored by kib on Aug 8 2022, 12:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 14, 1:29 PM
Unknown Object (File)
Jul 11 2025, 8:32 AM
Unknown Object (File)
Jun 28 2025, 11:44 PM
Unknown Object (File)
Jun 28 2025, 8:02 AM
Unknown Object (File)
Jun 25 2025, 8:47 PM
Unknown Object (File)
Jun 24 2025, 5:57 PM
Unknown Object (File)
Jun 24 2025, 12:41 PM
Unknown Object (File)
Jun 24 2025, 12:00 PM
Subscribers

Details

Summary
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 and tested by:    pho

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Aug 8 2022, 12:10 PM

I think linux_clone_thread() needs the same change?

Handle linuxolator use of cpu_copy_thread() as well

This revision is now accepted and ready to land.Aug 8 2022, 3:52 PM