DragonFlyBSD Kernel Audit
DF-1002 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/bus/u4b/storage/umass.c b/sys/bus/u4b/storage/umass.c
--- a/sys/bus/u4b/storage/umass.c
+++ b/sys/bus/u4b/storage/umass.c
@@ -2585,6 +2585,8 @@
 
 			csio = &ccb->csio;
 			page_list = (struct scsi_vpd_supported_page_list *)csio->data_ptr;
+			if (csio->dxfer_len < sizeof(struct scsi_vpd_supported_page_list))
+				break;
 			if (page_list->length + 1 < SVPD_SUPPORTED_PAGES_SIZE) {
 				page_list->list[page_list->length] = SVPD_UNIT_SERIAL_NUMBER;
 				page_list->length++;