* Pratik Vyas <m...@pd.io> [2018-02-16 09:15:07 -0800]:

* Abel Abraham Camarillo Ojeda <acam...@verlet.org> [2018-02-15 06:06:50 -0600]:

Synopsis:      vmctl(8) pause never returns

This should fix it. It checks if vm id is valid before sending to vmm
for pausing. The 'lock' is caused by vmm sending back ENOENT for a non
existent vm but vmd drops the message because it doesn't recogize the
vmid vmm is talking about. This is an artifact of the 'policy' don't
trust any imsg from a sibling priv sep processes and do your own
checking.


Index: usr.sbin/vmd/vmd.c
===================================================================
RCS file: /home/pdvyas/cvs/src/usr.sbin/vmd/vmd.c,v
retrieving revision 1.79
diff -u -p -a -u -r1.79 vmd.c
--- usr.sbin/vmd/vmd.c  10 Jan 2018 14:59:59 -0000      1.79
+++ usr.sbin/vmd/vmd.c  16 Feb 2018 17:06:20 -0000
@@ -186,6 +186,10 @@ vmd_dispatch_control(int fd, struct priv
                        } else {
                                vid.vid_id = vm->vm_vmid;
                        }
+               } else if (vm_getbyid(vid.vid_id) == NULL) {
+                       res = ENOENT;
+                       cmd = IMSG_VMDOP_PAUSE_VM_RESPONSE;
+                       break;
                }
                proc_compose_imsg(ps, PROC_VMM, -1, imsg->hdr.type,
                    imsg->hdr.peerid, -1, &vid, sizeof(vid));

Forgot to mention: asking for ok :)

Reply via email to