⬢ DragonFlyBSD Kernel Audit
DF-3897 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/raid/mps/mps_config.c b/sys/dev/raid/mps/mps_config.c
index 1111111..2222222 100644
--- a/sys/dev/raid/mps/mps_config.c
+++ b/sys/dev/raid/mps/mps_config.c
@@ -396,7 +396,9 @@
 	 * Check for valid WD configuration:
 	 *   volume type is RAID0
 	 *   number of phys disks in the volume is no more than 8
+	 *   (and at least one — DF-3897: 0 passes the >8 check and later
+	 *   divides by zero in mpssas_direct_drive_io, mps_sas.c:2190 et al)
 	 */
 	if ((raid_vol_pg0->VolumeType != MPI2_RAID_VOL_TYPE_RAID0) ||
+	    (raid_vol_pg0->NumPhysDisks == 0) ||
 	    (raid_vol_pg0->NumPhysDisks > 8)) {
 		mps_dprint(sc, MPS_FAULT,
 		    "Invalid WarpDrive configuration. Direct Drive I/O "