Re: [PATCH rdma-rc] RDMA/ucma: Correct option size check using optlen

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

 



On Wed, Mar 21, 2018 at 01:09:25PM -0500, Shiraz Saleem wrote:
> From: Chien Tin Tung <chien.tin.tung@xxxxxxxxx>
> 
> The option size check is using optval instead of optlen
> causing the set option call to fail. Use the correct
> field, optlen, for size check.
> 
> Fixes: 6a21dfc0d0db ("RDMA/ucma: Limit possible option size")
> Signed-off-by: Chien Tin Tung <chien.tin.tung@xxxxxxxxx>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>
> Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>  drivers/infiniband/core/ucma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
> index e5a1e7d..60449d6 100644
> +++ b/drivers/infiniband/core/ucma.c
> @@ -1307,7 +1307,7 @@ static ssize_t ucma_set_option(struct ucma_file *file, const char __user *inbuf,
>  	if (IS_ERR(ctx))
>  		return PTR_ERR(ctx);
>  
> -	if (unlikely(cmd.optval > KMALLOC_MAX_SIZE))
> +	if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE))
>  		return -EINVAL;

Gah! That was totally broken!

applied to for-rc

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux