Page MenuHomeFreeBSD

amd64: Clear the local TSS when creating a new thread
ClosedPublic

Authored by markj on Jun 1 2021, 10:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 26, 4:34 PM
Unknown Object (File)
Tue, Nov 25, 11:53 PM
Unknown Object (File)
Mon, Nov 24, 2:09 PM
Unknown Object (File)
Sun, Nov 23, 1:01 AM
Unknown Object (File)
Thu, Nov 20, 11:31 AM
Unknown Object (File)
Mon, Nov 10, 12:57 PM
Unknown Object (File)
Sun, Nov 9, 5:55 PM
Unknown Object (File)
Sun, Nov 9, 7:55 AM
Subscribers

Details

Summary

Otherwise it is copied from the creating thread. Then, if either thread
exits, the other is left with a dangling pointer, typically resulting in
a page fault upon the next context switch. This is equivalent to our
behaviour on i386.

Reported by: syzkaller

Test Plan

syzkaller generated a test case where a thread

  • calls sysarch(AMD64_SET_IOPERM)
  • creates a new thread

when the new thread exits, the current thread triggers
a page fault when reloading the TSS during a context switch.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable