x86/msr: Restrict MSR access when the kernel is locked down
authorMatthew Garrett <matthew.garrett@nebula.com>
Wed, 8 Nov 2017 15:11:34 +0000 (15:11 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 20 Mar 2018 08:31:07 +0000 (08:31 +0000)
commit250c0adb1ad8ed1040d2dc101bb0906200b3c70b
treeb6b2be7cc4fe430805616563c809ba7fb35fe246
parentadf4d329a2dd1e84e15d3846369ba475e5b6ad30
x86/msr: Restrict MSR access when the kernel is locked down

Writing to MSRs should not be allowed if the kernel is locked down, since
it could lead to execution of arbitrary code in kernel mode.  Based on a
patch by Kees Cook.

MSR accesses are logged for the purposes of building up a whitelist as per
Alan Cox's suggestion.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: "Lee, Chun-Yi" <jlee@suse.com>
cc: x86@kernel.org

Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0013-x86-msr-Restrict-MSR-access-when-the-kernel-is-locke.patch
arch/x86/kernel/msr.c