Bug 1759566
Summary: | CVE-2019-20485 virt:8.1/libvirt: potential DoS by holding a monitor job while querying QEMU guest-agent [rhel-av-8] | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Jonathon Jongsma <jjongsma> |
Component: | libvirt | Assignee: | Jonathon Jongsma <jjongsma> |
Status: | CLOSED ERRATA | QA Contact: | Lili Zhu <lizhu> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 8.0 | CC: | berrange, chhu, dyuan, jdenemar, jjongsma, jsuchane, knoel, lizhu, lmen, ppandit, rbalakri, tgolembi, xuzhang |
Target Milestone: | rc | Keywords: | Security, SecurityTracking |
Target Release: | 8.2 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-6.0.0-6.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1705426 | Environment: | |
Last Closed: | 2020-05-05 09:50:34 UTC | Type: | Bug |
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: | 1705426 | ||
Bug Blocks: | 1755482, 1809740 |
Description
Jonathon Jongsma
2019-10-08 14:06:31 UTC
The patch series has been pushed upstream. Relevant patches: 1cb8bc52c1035573a0c1a87f724a6c7dfee82f12 qemu: don't take agent and monitor job for shutdown 0a9893121187c0c3f9807e9164366e1f6977619c qemu: don't hold a monitor and agent job for reboot a663a860819287e041c3de672aad1d8543098ecc qemu: don't hold both jobs for suspend e005c95f56fee9ed780be7f8db103d690bd34cbd qemu: don't hold monitor and agent job when setting time ffa5066a49686e61991759983b0d7d1ba707fe50 qemu: remove use of qemuDomainObjBeginJobWithAgent() e888c0f66752bb6516d63a612c20f565cbf9c0ca qemu: rename qemuAgentGetFSInfoInternalDisk() bdb8a800b4920cf9184fd2fd117b17c67ba74dfb qemu: store complete agent filesystem information 306b4cb070b8f57a22a261d1f097283f4ef84e65 qemu: Don't store disk alias in qemuAgentDiskInfo 599ae372d8cf0923757c5a3792acb07dcf3e8802 qemu: don't access vmdef within qemu_agent.c 3c436c22a4f94c85c2b5e7b5fb84af48219d78e3 qemu: remove qemuDomainObjBegin/EndJobWithAgent() *** Bug 1809745 has been marked as a duplicate of this bug. *** reproduced this bug with: libvirt-daemon-5.6.0-10.module+el8.1.1+5309+6d656f05.x86_64 qemu-guest-agent-4.1.0-13.module+el8.1.0+4313+ef76ec61.x86_64 qemu-kvm-4.1.0-23.module+el8.1.1+5938+f5e53076.2.x86_64 1. prepare a guest with guest agent connected # virsh list --all Id Name State -------------------------------- 3 avocado-vt-vm1 running # virsh domtime avocado-vt-vm1 Time: 1584621438 2. set breakpoint on qmp_guest_set_time in guest [root@localhost ~]# gdb -p `pidof qemu-ga` .... (gdb) br qmp_guest_set_time Breakpoint 1 at 0x55eddab50b70 (gdb) c Continuing. Breakpoint 1, 0x000055eddab50b70 in qmp_guest_set_time () 3. try to set guest time # virsh domtime avocado-vt-vm1 --time 1584621357 (will hit the breakpoint, virsh will hang there) 4. try to change guest memory allocation # date; virsh setmem avocado-vt-vm1 1G; date Thu Mar 19 23:01:39 EDT 2020 error: Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchDomainSetTime) Thu Mar 19 23:02:09 EDT 2020 virsh will hang for 30 seconds Verify this bug with: libvirt-6.0.0-12.el8.x86_64 qemu-kvm-4.2.0-15.module+el8.2.0+6029+618ef2ec.x86_64 qemu-guest-agent-4.2.0-15.module+el8.2.0+6029+618ef2ec.x86_64 1. execute the first 3 steps in Comment #9 2. try to change guest memory allocation # date; virsh setmem rhel8.2 1G; date Thu Mar 19 23:16:18 EDT 2020 Thu Mar 19 23:16:18 EDT 2020 # virsh dommemstat rhel8.2 actual 1048576 swap_in 0 swap_out 0 major_fault 212 minor_fault 139225 unused 1183088 available 1354084 usable 1145764 last_update 1584672350 disk_caches 67852 hugetlb_pgalloc 0 hugetlb_pgfail 0 rss 1028196 command completes immediately and memory is updated except for qemuDomainPMSuspendForDuration(), since s3/s4 is disabled. For other 6 APIs, except for qemuDomainPMSuspendForDuration(), since s3/s4 is disabled. 1) set the breakpoints on corresponding qmp commands in qemu-guest-agent, refer to the 2nd coloum in the following matrix, - qemuDomainShutdownFlags() ---> qmp_guest_shutdown ---> virsh shutdown - qemuDomainReboot() ---> qmp_guest_shutdown ---> virsh reboot - qemuDomainSetVcpusFlags() ---> qmp_guest_set_vcpus ---> virsh setvcpus --guest --count - qemuDomainGetFSInfo() ---> qmp_guest_get_fsinfo ---> virsh domfsinfo - qemuDomainGetGuestInfo() ---> qmp_guest_get_osinf ---> virsh guestinfo 2) execute the virsh cmd in 3rd column 3) try to change guest memory allocation # date; virsh setmem rhel8.2 $size; date Fri Mar 20 12:22:03 EDT 2020 Fri Mar 20 12:22:03 EDT 2020 command completes immediately and memory is updated As the testing results match with expected results, mark the bug as verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2017 |