CVE-2014-0049: Buffer Overflow
Buffer overflow in the completeemulatedmmio function in arch/x86/kvm/x86.c in the Linux kernel before 3.13.6 allows guest OS users to execute arbitrary code on the host OS by leveraging a loop that triggers an invalid memory copy affecting certain cancelworkitem data.
Other sources
The problem occurs when the guest performs a pusha with the stack address pointing to an mmio address (or an invalid guest physical address) to start with, but then extending into an ordinary guest physical address. When doing repeated emulated pushes emulatorreadwrite sets mmioneeded to 1 on the first one. On a later push when the stack points to regular memory, mmionrfragments is set to 0, but mmioisneeded is not set to 0.
As a result, KVM exits to userspace, and then returns to completeemulatedmmio. In completeemulatedmmio vcpu->mmiocurfragment is incremented. The termination condition of vcpu->mmiocurfragment == vcpu->mmionrfragments is never achieved. The code bounces back and fourth to userspace incrementing mmiocurfragment past it's buffer. If the guest does nothing else it eventually leads to a a crash on a memcpy from invalid memory address.
However if a guest code can cause the vm to be destoryed in another vcpu with excellent timing, then kvmclearasyncpfcompletionqueue can be used by the guest to control the data that's pointed to by the call to cancelworkitem, which can be used to gain execution.
Introduced by: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f78146b0f
Acknowledgements:
Red Hat would like to thank Lars Bull of Google for reporting this issue.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1
Event History
Frequently Asked Questions
What is the severity of CVE-2014-0049?
CVE-2014-0049 is classified as a critical vulnerability due to its potential for remote code execution on the host OS.
How do I fix CVE-2014-0049?
To fix CVE-2014-0049, upgrade the Linux kernel to version 3.13.6 or later.
Which Linux kernel versions are affected by CVE-2014-0049?
CVE-2014-0049 affects Linux kernel versions prior to 3.13.6.
Can CVE-2014-0049 impact cloud services?
Yes, CVE-2014-0049 can impact cloud services that rely on the vulnerable versions of the Linux kernel.
What types of systems are at risk from CVE-2014-0049?
Systems running affected versions of the Linux kernel, particularly those hosting virtual machines, are at risk from CVE-2014-0049.