Skip to contentSkip to conversation

Staging: sep: potential buffer overflow in ioctl

PATCH New Dan Carpenter 1 participant 1 message Oct 29, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: sep: potential buffer overflow in ioctl

tail_size is determined by several variables that come from the user so we should verify that it's not too large.

drivers/staging/sep/sep_driver.c +2 -0
index 8ac3fae..e624e28 100644
@@ -2120,6 +2120,8 @@ static int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep,
 			}
 		}
 		if (tail_size) {
+			if (tail_size > sizeof(dcb_table_ptr->tail_data))
+				return -EINVAL;
 			if (is_kva = true) {
 				memcpy(dcb_table_ptr->tail_data,
 					(void *)(app_in_address + data_in_size -