[lkml]   [2015]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.18 35/39] x86, microcode: Return error from driver init code when loader is disabled
3.18-stable review patch.  If anyone has any objections, please let me know.


From: Boris Ostrovsky <>

commit da63865a01c6384d459464e5165d95d4f04878d8 upstream.

Commits 65cef1311d5d ("x86, microcode: Add a disable chicken bit") and
a18a0f6850d4 ("x86, microcode: Don't initialize microcode code on
paravirt") allow microcode driver skip initialization when microcode
loading is not permitted.

However, they don't prevent the driver from being loaded since the
init code returns 0. If at some point later the driver gets unloaded
this will result in an oops while trying to deregister the (never
registered) device.

To avoid this, make init code return an error on paravirt or when
microcode loading is disabled. The driver will then never be loaded.

Signed-off-by: Boris Ostrovsky <>
Reported-by: James Digwall <>
Signed-off-by: Borislav Petkov <>
Signed-off-by: Greg Kroah-Hartman <>

arch/x86/kernel/cpu/microcode/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -552,7 +552,7 @@ static int __init microcode_init(void)
int error;

if (paravirt_enabled() || dis_ucode_ldr)
- return 0;
+ return -EINVAL;

if (c->x86_vendor == X86_VENDOR_INTEL)
microcode_ops = init_intel_microcode();

 \ /
  Last update: 2015-02-09 10:01    [W:0.140 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site