Author: kib
Date: Thu Jul 11 16:22:49 2019
New Revision: 349913
URL: https://svnweb.freebsd.org/changeset/base/349913

Log:
  Ensure that mds_handler always points to a valid method.
  
  Depending on system configuration, version, and architecture,
  mds_handler might be dereferenced from doreti before
  hw_mds_recalculate_boot() initialized it.  Statically assign void
  method to cover all cases.
  
  Reported by:  "Schuendehuette, Matthias (LDA IT PLM)" 
<matthias.schuendehue...@siemens.com>
  Sponsored by: The FreeBSD Foundation
  MFC after:    3 days

Modified:
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/x86/x86/cpu_machdep.c
==============================================================================
--- head/sys/x86/x86/cpu_machdep.c      Thu Jul 11 16:19:33 2019        
(r349912)
+++ head/sys/x86/x86/cpu_machdep.c      Thu Jul 11 16:22:49 2019        
(r349913)
@@ -939,7 +939,6 @@ int hw_mds_disable;
  * architectural state except possibly %rflags. Also, it is always
  * called with interrupts disabled.
  */
-void (*mds_handler)(void);
 void mds_handler_void(void);
 void mds_handler_verw(void);
 void mds_handler_ivb(void);
@@ -948,6 +947,7 @@ void mds_handler_skl_sse(void);
 void mds_handler_skl_avx(void);
 void mds_handler_skl_avx512(void);
 void mds_handler_silvermont(void);
+void (*mds_handler)(void) = mds_handler_void;
 
 static int
 sysctl_hw_mds_disable_state_handler(SYSCTL_HANDLER_ARGS)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to