linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: leon@kernel.org, dledford@redhat.com, jgg@ziepe.ca
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [BUG] infiniband: mlx5: a possible null-pointer dereference in set_roce_addr()
Date: Mon, 29 Jul 2019 10:16:30 +0800	[thread overview]
Message-ID: <f99031cc-795e-92bd-9310-29c669ada7dc@gmail.com> (raw)

In set_roce_addr(), there is an if statement on line 589 to check 
whether gid is NULL:
     if (gid)

When gid is NULL, it is used on line 613:
     return mlx5_core_roce_gid_set(..., gid->raw, ...);

Thus, a possible null-pointer dereference may occur.

This bug is found by a static analysis tool STCheck written by us.

I do not know how to correctly fix this bug, so I only report it.


Best wishes,
Jia-Ju Bai

             reply	other threads:[~2019-07-29  2:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29  2:16 Jia-Ju Bai [this message]
2019-07-29  5:20 ` [BUG] infiniband: mlx5: a possible null-pointer dereference in set_roce_addr() Leon Romanovsky
2019-07-29  5:25 ` Parav Pandit
2019-07-29  5:26   ` Parav Pandit
2019-07-29  5:52     ` Leon Romanovsky

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=f99031cc-795e-92bd-9310-29c669ada7dc@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).