From: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Nitzan Carmi <nitzanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
RDMA mailing list
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Max Gurtovoy <maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH rdma-rc] IB/mlx5: Fix mlx5_ib_alloc_mr error flow
Date: Wed, 27 Dec 2017 15:32:57 -0700 [thread overview]
Message-ID: <20171227223257.GB1523@ziepe.ca> (raw)
In-Reply-To: <20171226092020.8106-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On Tue, Dec 26, 2017 at 11:20:20AM +0200, Leon Romanovsky wrote:
> From: Nitzan Carmi <nitzanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> ibmr.device is being set only after ib_alloc_mr() is
> (successfully) complete. Therefore, in case mlx5_core_create_mkey()
> return with error, the error flow calls mlx5_free_priv_descs()
> which uses ibmr.device (which doesn't exist yet), causing
> NULL dereference and gets the system into kernel panic.
>
> To fix this, the IB device should be given to mr struct in earlier
> stage (e.g. prior to calling mlx5_core_create_mkey()).
>
> Fixes: 8a187ee52b04 ("IB/mlx5: Support the new memory registration API")
> Signed-off-by: Max Gurtovoy <maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Nitzan Carmi <nitzanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> drivers/infiniband/hw/mlx5/mr.c | 1 +
> 1 file changed, 1 insertion(+)
Applied to for-rc, thanks
Jason
--
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
prev parent reply other threads:[~2017-12-27 22:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-26 9:20 [PATCH rdma-rc] IB/mlx5: Fix mlx5_ib_alloc_mr error flow Leon Romanovsky
[not found] ` <20171226092020.8106-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-27 22:32 ` Jason Gunthorpe [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=20171227223257.GB1523@ziepe.ca \
--to=jgg-uk2m96/98pc@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=nitzanc-VPRAkNaXOzVWk0Htik3J/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox