On Sun, May 9, 2021 at 1:24 PM Leon Romanovsky <leon@xxxxxxxxxx> wrote: > > 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? Hi Leon, The server code checks for the queue_depth before sending. If the server is really running malicious code, then the queue_depth is the last thing that the client needs to worry about. > > 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 > >