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)
Feb 14 2024, 12:24 AM
Unknown Object (File)
Feb 5 2024, 11:38 PM
Unknown Object (File)
Dec 31 2023, 12:08 AM
Unknown Object (File)
Dec 20 2023, 2:05 AM
Unknown Object (File)
Dec 16 2023, 3:02 AM
Unknown Object (File)
Dec 12 2023, 2:38 PM
Unknown Object (File)
Nov 27 2023, 8:29 PM
Unknown Object (File)
Nov 22 2023, 8:52 PM
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