git: DragonFly_RELEASE_5_8 kernel - Fix efivar panic

Matthew Dillon dillon at crater.dragonflybsd.org
Thu May 28 23:55:35 PDT 2020


commit ab389c7808ca11388ecd888184fdf107d60e1e52
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu May 28 22:41:32 2020 -0700

    kernel - Fix efivar panic
    
    * The efirt driver uses direct-map mode, and creates an independent
      pmap to hold it.  The direct map typically uses userspace addresses,
      so SMAP must be disabled across any EFI call.
    
    * Add smap_open(), smap_close(), smap_smep_disable(), and
      smap_smep_enable() calls for C.
    
      NOTE: We also have to set pcb_onfault to non-NULL to bypass failsafe
    	checks done in trap().
    
    * Hack the EFI address space code to disable SMAP and SMEP across
      the EFI call.  Unfortunately since we also have to disable SMEP,
      these functions have to manipulate CR4.
    
    Reported-by: daftaupe

Summary of changes:
 sys/cpu/x86_64/include/cpufunc.h   |  2 ++
 sys/platform/pc64/x86_64/efirt.c   |  5 +++++
 sys/platform/pc64/x86_64/pmap.c    | 42 ++++++++++++++++++++++++++++++++++++++
 sys/platform/pc64/x86_64/support.s | 10 +++++++++
 sys/platform/pc64/x86_64/trap.c    |  2 ++
 sys/vm/pmap.h                      |  2 ++
 6 files changed, 63 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ab389c7808ca11388ecd888184fdf107d60e1e52


-- 
DragonFly BSD source repository



More information about the Commits mailing list