summaryrefslogtreecommitdiff
path: root/drivers/staging/sep
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-10-29 11:20:20 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-27 05:23:57 +0400
commit9638b67ba25b4a008767fca3b6f52d24400a8d1d (patch)
tree64b97208e939b96f83ef2409a5687d3d95be4697 /drivers/staging/sep
parent23226977e9421434a2e7e384219477199ca5f0ec (diff)
downloadlinux-9638b67ba25b4a008767fca3b6f52d24400a8d1d.tar.xz
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. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sep')
-rw-r--r--drivers/staging/sep/sep_driver.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index 8ac3faea2d2f..e624e2874902 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -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 -