]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/bugs: Rework spec_ctrl base and mask logic
authorThomas Gleixner <tglx@linutronix.de>
Sat, 12 May 2018 18:10:00 +0000 (20:10 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 22 May 2018 16:27:11 +0000 (18:27 +0200)
commite5f984edc9adbbfd58553b04f541352a4a7ef4f6
tree5c186649fab6f35fd1bc1668e4fbae65685481dc
parent208efa83df3a9822ebdeb29f7e4c67a23cd35011
x86/bugs: Rework spec_ctrl base and mask logic

x86_spec_ctrL_mask is intended to mask out bits from a MSR_SPEC_CTRL value
which are not to be modified. However the implementation is not really used
and the bitmask was inverted to make a check easier, which was removed in
"x86/bugs: Remove x86_spec_ctrl_set()"

Aside of that it is missing the STIBP bit if it is supported by the
platform, so if the mask would be used in x86_virt_spec_ctrl() then it
would prevent a guest from setting STIBP.

Add the STIBP bit if supported and use the mask in x86_virt_spec_ctrl() to
sanitize the value which is supplied by the guest.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
CVE-2018-3639 (x86)

(cherry-picked from commit be6fcb5478e95bb1c91f489121238deb3abca46a)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/cpu/bugs.c