Bug 1595143 (CVE-2018-12904)

Summary: CVE-2018-12904 kernel: kvm: nVMX: missing privilege check allows privilege escalation in nested virtualization
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: airlied, aquini, bhu, blc, bskeggs, dhoward, ewk, fhrbata, hdegoede, hkrzesin, hwkernel-mgr, iboverma, ichavero, itamar, jarodwilson, jforbes, jglisse, jkacur, john.j5live, jonathan, josef, jross, jstancek, jwboyer, kernel-maint, kernel-mgr, labbott, lgoncalv, linville, lwang, matt, mchehab, mcressma, mjg59, mlangsdo, nmurray, plougher, ppandit, rt-maint, rvrbovsk, skozina, steved, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 4.17.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-12 13:05:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1595145, 1595146    
Bug Blocks: 1595148    

Description Adam Mariš 2018-06-26 08:42:45 UTC
It was found that KVM virtualizing another hypervisor as L1 VM does not verify that VMX instructions from L1 VM (which trigger a VM exit and are emulated by L0 KVM) are coming from ring 0. This means that a normal user space program running in the L1 VM can trigger KVMs VMX emulation which gives a large number of privilege escalation vectors. This issue happens only if L2 guest is running, since VMX emulation code checks for the guests CR4.VMXE value.

This allows attacker in L2 guest to break out e.g. by exploiting a bug in L1 qemu process and using this bug for privilege escalation on the L1 system.

Bug report:

https://bugs.chromium.org/p/project-zero/issues/detail?id=1589

Upstream patch:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=727ba748e110b4de50d142edca9d6a9b7e6111d8

Comment 1 Adam Mariš 2018-06-26 08:43:47 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1595146]

Comment 3 Adam Mariš 2018-06-27 12:30:59 UTC
CVE known via:

http://seclists.org/oss-sec/2018/q2/246

Comment 4 Prasad Pandit 2018-08-29 18:54:47 UTC
Statement:

This issue does not affect the versions of the kernel package as shipped with
Red Hat Enterprise Linux 5, 6, 7 and Red Hat Enterprise MRG 2.

Comment 7 Product Security DevOps Team 2019-07-12 13:05:42 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2018-12904