pmcraid: redundant check in pmcraid_check_ioctl_buffer()?
Subsystems (2)
PATCH 1/1 pmcraid: redundant check in pmcraid_check_ioctl_buffer()?
struct pmcraid_ioctl_header member buffer_length is unsigned, so this check appears redundant.
Signed-off-by Roel Kluin <[email protected]>
---
Or should we replace it by a check like
if (hdr->buffer_length > MAX) ... ?
drivers/scsi/pmcraid.c +0 -6
@@ -3731,12 +3731,6 @@ static int pmcraid_check_ioctl_buffer(return -EINVAL ; } -/* buffer length can't be negetive */ -if (hdr->buffer_length <0 ) { -pmcraid_err ("ioctl: invalid buffer length specified\n" ); -return -EINVAL ; - } -/* check for appropriate buffer access */ if ((_IOC_DIR (cmd) & _IOC_READ) == _IOC_READ) access =VERIFY_WRITE ;
I agree this check is not necessary.
Signed-off-by Anil Ravindranath <[email protected]>
Quoted 26 lines · Roel Kluin
struct
pmcraid_ioctl_headermemberbuffer_lengthis unsigned, so this check appears redundant.Signed-off-by Roel Kluin <[email protected]>---
Or should we replace it by a check like
if (hdr->buffer_length> MAX) ... ?drivers/scsi/pmcraid.c +0
-6@@ -3731,12 +3731,6 @@ static int pmcraid_check_ioctl_buffer(return -EINVAL ; } -/* buffer length can't be negetive */ -if (hdr->buffer_length <0 ) { -pmcraid_err ("ioctl: invalid buffer length specified\n" ); -return -EINVAL ; - } -/* check for appropriate buffer access */ if ((_IOC_DIR (cmd) & _IOC_READ) == _IOC_READ) access =VERIFY_WRITE ;