[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLUPR18MB013099199B96DDC73099D0E5A1B40@BLUPR18MB0130.namprd18.prod.outlook.com>
Date: Tue, 25 Dec 2018 13:13:35 +0000
From: Michal Kalderon <mkalderon@...vell.com>
To: Aditya Pakki <pakki001@....edu>
CC: "kjlu@....edu" <kjlu@....edu>,
Michal Kalderon <Michal.Kalderon@...ium.com>,
Ariel Elior <Ariel.Elior@...ium.com>,
"Doug Ledford" <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [EXT] [PATCH] infiniband/qedr: Potential null ptr dereference of
qp
> From: Aditya Pakki <pakki001@....edu>
> Sent: Monday, December 24, 2018 8:25 PM
>
> External Email
>
> ----------------------------------------------------------------------
> External Email
>
> idr_find() may fail and return a NULL pointer. The fix checks the return value
> of the function and returns an error in case of NULL.
>
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
> drivers/infiniband/hw/qedr/qedr_iw_cm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> index 505fa3648762..93b16237b767 100644
> --- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> +++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> @@ -492,6 +492,8 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct
> iw_cm_conn_param *conn_param)
> int i;
>
> qp = idr_find(&dev->qpidr.idr, conn_param->qpn);
> + if (unlikely(!qp))
> + return -EINVAL;
>
> laddr = (struct sockaddr_in *)&cm_id->m_local_addr;
> raddr = (struct sockaddr_in *)&cm_id->m_remote_addr;
> --
> 2.17.1
Thanks,
Acked-by: Michal Kalderon <michal.kalderon@...vell.com>
Powered by blists - more mailing lists