to VMCI_INVALID_HANDLE, a doorbell was being created with context id 0
(hypervisor id) and a large resource id (likely the garbage value in
handle.resource).
On the guest side, modified VMCINotifyHashAddEntry so that if the handle
passed down is not VMCI_INVALID_HANDLE and if the context id of the handle
is not the context id of the VM, VMCI_ERROR_INVALID_ARGS will be returned.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
goto out;
}
entry->handle = newHandle;
+ } else if (VMCI_GetContextID() != entry->handle.context) {
+ /*
+ * The context id passed down should either be invalid or
+ * the context id of the guest.
+ */
+
+ result = VMCI_ERROR_INVALID_ARGS;
+ goto out;
}
if (VMCINotifyHashFindByHandle(entry->handle, entry->doorbell, &bucket)) {