All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	oulijun <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Subject: Re: [bug report] IB/hns: Fix the bug when destroy qp
Date: Tue, 7 Feb 2017 18:32:18 +0800	[thread overview]
Message-ID: <5899A232.9040000@huawei.com> (raw)
In-Reply-To: <20170207092650.GA26924@mwanda>

Hi, Dan Carpenter
    Thanks for your comment.
    We will fix it.
    Thanks very much!

Regards
Wei Hu (Xavier)

On 2017/2/7 17:26, Dan Carpenter wrote:
> Hello Wei Hu (Xavier),
>
> The patch d838c481e025: "IB/hns: Fix the bug when destroy qp" from
> Nov 29, 2016, leads to the following static checker warning:
>
> 	drivers/infiniband/hw/hns/hns_roce_hw_v1.c:3686 hns_roce_v1_destroy_qp_work_fn()
> 	error: dereferencing freed memory 'hr_qp'
>
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c
>    3674          hns_roce_qp_remove(hr_dev, hr_qp);
>    3675          hns_roce_qp_free(hr_dev, hr_qp);
>    3676
>    3677          if (hr_qp->ibqp.qp_type == IB_QPT_RC) {
>    3678                  /* RC QP, release QPN */
>    3679                  hns_roce_release_range_qp(hr_dev, hr_qp->qpn, 1);
>    3680                  kfree(hr_qp);
>                                ^^^^^
> Free.
>
>    3681          } else
>    3682                  kfree(hr_to_hr_sqp(hr_qp));
>    3683
>    3684          kfree(qp_work_entry);
>    3685
>    3686          dev_dbg(dev, "Accomplished destroy QP(0x%lx) work.\n", hr_qp->qpn);
>                                                                         ^^^^^^^^^^
> Use after free.
>
>    3687  }
>
>
> regards,
> dan carpenter
>
> .
>


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2017-02-07 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  9:26 [bug report] IB/hns: Fix the bug when destroy qp Dan Carpenter
2017-02-07 10:32 ` Wei Hu (Xavier) [this message]

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=5899A232.9040000@huawei.com \
    --to=xavier.huwei-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.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 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.