From: Jason Gunthorpe <jgg@nvidia.com>
To: <linux-rdma@vger.kernel.org>
Cc: Hillf Danton <hdanton@sina.com>,
<syzbot+4088ed905e4ae2b0e13b@syzkaller.appspotmail.com>
Subject: Re: [PATCH] RDMA/core: Fix bogus WARN_ON during ib_unregister_device_queued()
Date: Thu, 2 Jul 2020 14:29:05 -0300 [thread overview]
Message-ID: <20200702172905.GA719475@nvidia.com> (raw)
In-Reply-To: <0-v1-a36d512e0a99+762-syz_dealloc_driver_jgg@nvidia.com>
On Fri, Jun 26, 2020 at 02:49:10PM -0300, Jason Gunthorpe wrote:
> ib_unregister_device_queued() can only be used by drivers using the new
> dealloc_device callback flow, and it has a safety WARN_ON to ensure
> drivers are using it properly.
>
> However, if unregister and register are raced there is a special
> destruction path that maintains the uniform error h andling semantic of
> 'caller does ib_dealloc_device() on failure'. This requires disabling the
> dealloc_device callback which triggers the WARN_ON.
>
> Instead of using NULL to disable the callback use a special function
> pointer so the WARN_ON does not trigger.
>
> Reported-by: syzbot+4088ed905e4ae2b0e13b@syzkaller.appspotmail.com
> Suggested-by: Hillf Danton <hdanton@sina.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/core/device.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> As outlined by Hillf, seems like it is OK.
Applied to for-next
Jason
prev parent reply other threads:[~2020-07-02 17:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 17:49 [PATCH] RDMA/core: Fix bogus WARN_ON during ib_unregister_device_queued() Jason Gunthorpe
2020-06-28 8:02 ` Leon Romanovsky
2020-07-02 17:29 ` 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=20200702172905.GA719475@nvidia.com \
--to=jgg@nvidia.com \
--cc=hdanton@sina.com \
--cc=linux-rdma@vger.kernel.org \
--cc=syzbot+4088ed905e4ae2b0e13b@syzkaller.appspotmail.com \
/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).