Re: [PATCH for-next 03/20] RDMA/rtrs-clt: No need to check queue_depth when receiving

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

 



On Mon, May 03, 2021 at 01:48:01PM +0200, Gioh Kim wrote:
> From: Gioh Kim <gi-oh.kim@xxxxxxxxxxxxxxx>
> 
> The queue_depth size is sent from server and
> server already checks validity of the value.

Do you trust server? What will be if server is not reliable and sends
garbage?

Thanks

> 
> Signed-off-by: Gioh Kim <gi-oh.kim@xxxxxxxxx>
> Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxx>
> ---
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> index 930a1b496f84..0c828ea0f500 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> @@ -1772,12 +1772,6 @@ static int rtrs_rdma_conn_established(struct rtrs_clt_con *con,
>  	}
>  	if (con->c.cid == 0) {
>  		queue_depth = le16_to_cpu(msg->queue_depth);
> -
> -		if (queue_depth > MAX_SESS_QUEUE_DEPTH) {
> -			rtrs_err(clt, "Invalid RTRS message: queue=%d\n",
> -				  queue_depth);
> -			return -ECONNRESET;
> -		}
>  		if (!sess->rbufs || sess->queue_depth < queue_depth) {
>  			kfree(sess->rbufs);
>  			sess->rbufs = kcalloc(queue_depth, sizeof(*sess->rbufs),
> -- 
> 2.25.1
> 



[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