summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/msr.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-02-20 19:44:19 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-20 19:44:19 -0800
commit317d4f459393e27b3efedf571bd9e78a23fcd2ed (patch)
treeed9c133af037d51773aa16a11df8fa04cfa12148 /arch/x86/kernel/msr.c
parentae821d2107e378bb086a02afcce82d0f43c29a6f (diff)
parent02a16aa13574c8526beadfc9ae8cc9b66315fa2d (diff)
Merge tag 'x86_misc_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 misc updates from Borislav Petkov: - Complete the MSR write filtering by applying it to the MSR ioctl interface too. - Other misc small fixups. * tag 'x86_misc_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/MSR: Filter MSR writes through X86_IOC_WRMSR_REGS ioctl too selftests/fpu: Fix debugfs_simple_attr.cocci warning selftests/x86: Use __builtin_ia32_read/writeeflags x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk
Diffstat (limited to 'arch/x86/kernel/msr.c')
-rw-r--r--arch/x86/kernel/msr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 8a67d1fa8dc5..ed8ac6bcbafb 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -182,6 +182,13 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
err = security_locked_down(LOCKDOWN_MSR);
if (err)
break;
+
+ err = filter_write(regs[1]);
+ if (err)
+ return err;
+
+ add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+
err = wrmsr_safe_regs_on_cpu(cpu, regs);
if (err)
break;