DragonFlyBSD/src 48c77f2sys/cpu/x86_64/include asmacros.h specialreg.h, sys/platform/pc64/x86_64 support.s machdep.c

kernel - Implement support for SMAP and SMEP security

* Implement support for SMAP security.  This prevents accidental
  accesses to user address space from the kernel.  When available,
  we wrap intentional user-space accesses from the kernel with
  the 'stac' and 'clac' instructions.

  We use a NOP replacement policy to implement the feature.  The wrapper
  is initially a 'nop %eax' (3-byte NOP), and is replaced by 'stac' and
  'clac' via a .section iteration when the feature is supported.

* Implement support for SMEP security.  This prevents accidental
  execution of user code from the kernel and simply requires
  turning the bit on in CR4.

* Reports support in dmesg via the 'CPU Special Features Installed:'
  line.
DeltaFile
+36-4sys/platform/pc64/x86_64/support.s
+27-0sys/platform/pc64/x86_64/machdep.c
+22-0sys/cpu/x86_64/include/asmacros.h
+12-6sys/platform/pc64/x86_64/identcpu.c
+11-0sys/platform/pc64/x86_64/pmap.c
+3-1sys/platform/pc64/x86_64/initcpu.c
+4-0sys/cpu/x86_64/include/specialreg.h
+115-117 files

UnifiedSplitRaw