git: Kernel - Additional cpu bug hardening part 2/2

Matthew Dillon dillon at
Mon Jun 11 14:38:49 PDT 2018

commit 9474cbef7fcb61cd268019694d94db6a75af7dbe
Author: Matthew Dillon <dillon at>
Date:   Mon Jun 11 14:30:40 2018 -0700

    Kernel - Additional cpu bug hardening part 2/2
    * Due to speculative instruction execution, the kernel may
      speculatively execute instructions using data from registers that
      still contain userland-controlled content.
      Reduce the chance of this situation arising by proactively clearing
      all user registers after saving them for syscalls, exceptions, and
      interrupts.  In addition, for system calls, zero-out any
      unrestored registers on-return to avoid leaking kernel data back to
    * This was discussed over the last few months in various
      OS groups and I've decided to implement it.  After the FP
      debacle, it is prudent to also give general registers similar

Summary of changes:
 sys/cpu/x86_64/include/asmacros.h    | 19 ++++++++++++++++++-
 sys/platform/pc64/x86_64/exception.S | 32 +++++++++++++++++++++++++++++++-
 2 files changed, 49 insertions(+), 2 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list