Date: Thu, 11 Jul 2019 16:22:50 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349913 - head/sys/x86/x86 Message-ID: <201907111622.x6BGMoZ3019246@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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.schuendehuette@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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907111622.x6BGMoZ3019246>