]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/microcode: Recheck IBRS and IBPB feature on microcode reload
authorTim Chen <tim.c.chen@linux.intel.com>
Mon, 18 Dec 2017 18:37:31 +0000 (10:37 -0800)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:19:57 +0000 (10:19 -0800)
On new microcode write, check whether IBRS and IBPB features
are present by rescanning scattered CPU features.

Orabug: 27344012
CVE: CVE-2017-5715

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/kernel/cpu/microcode/core.c

index 36a83617eb21cc19245794a89c986eba45179d3a..44fe1cfee5fed6a4b9b1968b4fc5c9e9eb53fc0e 100644 (file)
@@ -231,6 +231,11 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,
        if (ret > 0)
                perf_check_microcode();
 
+       /* check spec_ctrl capabilities */
+       mutex_lock(&spec_ctrl_mutex);
+       init_scattered_cpuid_features(&boot_cpu_data);
+       mutex_unlock(&spec_ctrl_mutex);
+
        mutex_unlock(&microcode_mutex);
        put_online_cpus();