All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kalderon <mkalderon@marvell.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: "kjlu@umn.edu" <kjlu@umn.edu>,
	Michal Kalderon <Michal.Kalderon@cavium.com>,
	Ariel Elior <Ariel.Elior@cavium.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [EXT] [PATCH] infiniband/qedr: Potential null ptr dereference of qp
Date: Tue, 25 Dec 2018 13:13:35 +0000	[thread overview]
Message-ID: <BLUPR18MB013099199B96DDC73099D0E5A1B40@BLUPR18MB0130.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20181224182445.21256-1-pakki001@umn.edu>

> From: Aditya Pakki <pakki001@umn.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@umn.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@marvell.com>

  parent reply	other threads:[~2018-12-25 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-24 18:24 [PATCH] infiniband/qedr: Potential null ptr dereference of qp Aditya Pakki
2018-12-25  4:26 ` Leon Romanovsky
2018-12-25 13:13 ` Michal Kalderon [this message]
2019-01-02 23:28 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLUPR18MB013099199B96DDC73099D0E5A1B40@BLUPR18MB0130.namprd18.prod.outlook.com \
    --to=mkalderon@marvell.com \
    --cc=Ariel.Elior@cavium.com \
    --cc=Michal.Kalderon@cavium.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.