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
F169806657: D30607.id90288.diff
Wed, Sep 2, 3:14 PM
Unknown Object (File)
Tue, Sep 1, 11:58 AM
Unknown Object (File)
Tue, Sep 1, 11:12 AM
Unknown Object (File)
Tue, Sep 1, 7:38 AM
Unknown Object (File)
Mon, Aug 31, 3:08 PM
Unknown Object (File)
Sun, Aug 30, 9:28 AM
Unknown Object (File)
Sun, Aug 30, 7:52 AM
Unknown Object (File)
Sun, Aug 30, 6:36 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 39656
Build 36545: arc lint + arc unit