⬢ DragonFlyBSD Kernel Audit
DF-4221 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/virtual/vmware/pvscsi/pvscsi.c
+++ b/sys/dev/virtual/vmware/pvscsi/pvscsi.c
@@ -902,6 +902,17 @@
 
 	ccb = hcb->ccb;
 
+	if (ccb == NULL) {
+		/* Duplicate or spurious completion for an hcb that is not
+		 * in flight (already completed, or never issued).  The
+		 * completion entry is device(hypervisor)-fed DMA; do not
+		 * dereference the NULL ccb below. */
+		device_printf(sc->dev,
+		    "completion for idle context %llu ignored\n",
+		    (unsigned long long)e->context);
+		return;
+	}
+
 	btstat = e->host_status;
 	sdstat = e->scsi_status;