Re: [PATCH] pmcraid: redundant check in pmcraid_check_ioctl_buffer()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I agree this check is not necessary.

Signed-off-by: Anil Ravindranath <anil_ravindranath@xxxxxxxxxxxxxx>

On Wed, 21 Oct 2009, Roel Kluin wrote:

> struct pmcraid_ioctl_header member buffer_length is unsigned, so
> this check appears redundant.
> 
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> ---
> Or should we replace it by a check like
> if (hdr->buffer_length > MAX) ... ?
> 
> diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
> index f7c70e2..e448776 100644
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -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;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux