Ubuntu-5.0.0-33.35 introduces KVM regression with old Intel CPUs and Linux guests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
High
|
Thadeu Lima de Souza Cascardo | ||
Disco |
Fix Released
|
High
|
Thadeu Lima de Souza Cascardo |
Bug Description
[Impact]
On CPUs with no EPT support, or when disabling kvm-intel ept support by use of ept=0 module parameter, users are not able to launch a linux VM.
[Test case]
# modprobe kvm-intel ept=0
# cat /sys/module/
N
# qemu-system-x86_64 -enable-kvm -kernel /boot/vmlinuz-
Make sure you get console log at all. With the bug, there is not a single line of output.
[Regression potential]
The fix might cause some very specific use of virtualization to fail, but no pratical case is known.
=======
Mostly the same info as on a related kernel.org bugzilla entr[0].
[0]: https:/
We got issues reported with old Intel CPUs and Linux guest run with QEMU/KVM after a recent kernel update which is based on Ubuntu-5.0.0-33.35.
I bisected this here, with following result:
git bisect log
# bad: [3b931173c97b0d
# good: [5d5a6b36e94909
git bisect start '3b931173c97b0d
'5d5a6b36e94909
# good: [7b4f844b33969a
of removed device from queue
git bisect good 7b4f844b33969ab
# bad: [6c1fc88702a4f3
an ISB following walk cache invalidation
git bisect bad 6c1fc88702a4f33
# good: [e627a027b54ecc
to compat ioctl
git bisect good e627a027b54eccc
# good: [29919eff6333bc
for Denverton and beyond
git bisect good 29919eff6333bc6
# good: [cb44193f94af73
compiler warning
git bisect good cb44193f94af739
# good: [b1d479b27b2696
callback
git bisect good b1d479b27b26966
# bad: [ec15813844b05d
MS-1039 laptop to flip_dmi_table
git bisect bad ec15813844b05d8
# good: [e83601f51a90d9
Cards to prevent kernel crash
git bisect good e83601f51a90d97
# good: [6d393bdf3b3f4b
ctxt->have_
git bisect good 6d393bdf3b3f4b6
# bad: [208007519a7385
reserved bits when loading PDPTRS
git bisect bad 208007519a7385a
# first bad commit: [208007519a7385
Manually calculate reserved bits when loading PDPTRS
Which is:
KVM: x86: Manually calculate reserved bits when loading PDPTRS
BugLink: https:/
commit 16cfacc8085782d
Manually generate the PDPTR reserved bit mask when explicitly loading
PDPTRs. The reserved bits that are being tracked by the MMU reflect the
current paging mode, which is unlikely to be PAE paging in the vast
majority of flows that use load_pdptrs(), e.g. CR0 and CR4 emulation,
__set_sregs(), etc... This can cause KVM to incorrectly signal a bad
PDPTR, or more likely, miss a reserved bit check and subsequently fail
a VM-Enter due to a bad VMCS.GUEST_PDPTR.
Add a one off helper to generate the reserved bits instead of sharing
code across the MMU's calculations and the PDPTR emulation. The PDPTR
reserved bits are basically set in stone, and pushing a helper into
the MMU's calculation adds unnecessary complexity without improving
readability.
Oppurtunist
Note, the buggy commit also introduced a deliberate functional change,
"Also remove bit 5-6 from rsvd_bits_mask per latest SDM.", which was
effectively (and correctly) reverted by commit cd9ae5fe47df ("KVM: x86:
Fix page-tables reserved bits"). A bit of SDM archaeology shows that
the SDM from late 2008 had a bug (likely a copy+paste error) where it
listed bits 6:5 as AVL and A for PDPTEs used for 4k entries but reserved
for 2mb entries. I.e. the SDM contradicted itself, and bits 6:5 are and
always have been reserved.
Fixes: 20c466b56168d ("KVM: Use rsvd_bits_mask in load_pdptrs()")
Cc: <email address hidden>
Cc: Nadav Amit <email address hidden>
Reported-by: Doug Reiland <email address hidden>
Signed-off-by: Sean Christopherson <email address hidden>
Reviewed-by: Peter Xu <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>
This one is also included in the 4.19.81 (or more correctly, it's there since
v4.19.77) with commit 496cf984a60edb5
upstream commit 16cfacc8085782d
[0]:
https:/
[1]: https:/
Funny thing is: I cannot reproduce this with a 5.3.7 (Eoan) kernel, which _also_
includes above commit. So possible another patch is missing in the backport,
did not find anything obvious though...
So summary for reproducer:
* dust of an host with old Intel CPU, e.g.: Intel Core2Duo CPU E8500 @3.16GHz
(something else westmer, conroe or the like should work too, or if it's
released
over 10 years ago.
* Install a Linux Distro or just boot the installer of that in a VM, I used
Debian 9,
as our users had issues with that but *not* with an ubuntu 19.10 VM.
* see how it boot loops once a stable-kernel with above[0] backported
is used on the host
CVE References
Changed in linux (Ubuntu Bionic): | |
assignee: | nobody → Thadeu Lima de Souza Cascardo (cascardo) |
Changed in linux (Ubuntu Disco): | |
assignee: | nobody → Thadeu Lima de Souza Cascardo (cascardo) |
Changed in linux (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in linux (Ubuntu Disco): | |
importance: | Undecided → High |
description: | updated |
Changed in linux (Ubuntu Disco): | |
status: | New → In Progress |
Changed in linux (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in linux (Ubuntu Bionic): | |
importance: | Undecided → High |
Changed in linux (Ubuntu Disco): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1851709
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.