kernel - Add safety for Intel SYSRET issue
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Jul 2014 19:31:50 +0000 (12:31 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Jul 2014 19:37:33 +0000 (12:37 -0700)
commitdb2ac896813080e775d0cce25ee903932bc75292
tree8858fce04d7c208cb97ccb64591c210a1ac0a158
parent03ad0861ba66a7f2416cd87b875046ce88970bf7
kernel - Add safety for Intel SYSRET issue

* First, insofar as we can tell DragonFly was *NOT* vulnerable to the
  Intel SYSRET issue.  We have a RQF_QUICKRET flag that determines if SYSRET
  can be used.  Any heavy weight process switch, signal delivery, signal
  return, or set_regs() call clears this flag and forces the system call to
  return via IRET.

* However, the ptrace() path is a bit convoluted.  Insofar as I can tell
  it just won't allow %rip to be changed unless the target process is in
  a SSTOPped state, meaning that a heavy weight context switch must occur
  before the new %rip is used which means we should be safe.

  Still, we are adding a safety to ptrace_set_pc() to cannonicalize the
  %rip anyway, to ensure that this bug cannot bite us indirectly in the
  future.
sys/platform/pc64/x86_64/machdep.c