Skip to content

Commit 25d0dc4

Browse files
ashok-rajbp3tk0v
authored andcommitted
x86/microcode: Allow only "1" as a late reload trigger value
Microcode gets reloaded late only if "1" is written to the reload file. However, the code silently treats any other unsigned integer as a successful write even though no actions are performed to load microcode. Make the loader more strict to accept only "1" as a trigger value and return an error otherwise. [ bp: Massage commit message. ] Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Ashok Raj <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a9a5cac commit 25d0dc4

File tree

1 file changed

+2
-5
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+2
-5
lines changed

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,8 @@ static ssize_t reload_store(struct device *dev,
475475
ssize_t ret = 0;
476476

477477
ret = kstrtoul(buf, 0, &val);
478-
if (ret)
479-
return ret;
480-
481-
if (val != 1)
482-
return size;
478+
if (ret || val != 1)
479+
return -EINVAL;
483480

484481
cpus_read_lock();
485482

0 commit comments

Comments
 (0)