twizzler-operating-system / twizzler

The Twizzler Operating System
BSD 3-Clause "New" or "Revised" License
66 stars 14 forks source link

Disable interrupts before return to user during userinit. #195

Closed dbittman closed 1 month ago

dbittman commented 1 month ago

Fixes a race condition where the kernel could see an interrupt occurring after the return_to_user code called by userinit resets the FS segment value, but before we have switched to user. This causes all TLS variables in the kernel to cause a crash on the next load. The fix mirrors the exit path code for syscalls better.