linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: linux-rdma@vger.kernel.org, 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: Sun, 28 Jun 2020 11:02:02 +0300	[thread overview]
Message-ID: <20200628080202.GB6281@unreal> (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

"h andling" -> "handling"

> '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>
> ---
>  drivers/infiniband/core/device.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

  reply	other threads:[~2020-06-28  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 17:49 Jason Gunthorpe
2020-06-28  8:02 ` Leon Romanovsky [this message]
2020-07-02 17:29 ` 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=20200628080202.GB6281@unreal \
    --to=leon@kernel.org \
    --cc=hdanton@sina.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=syzbot+4088ed905e4ae2b0e13b@syzkaller.appspotmail.com \
    --subject='Re: [PATCH] RDMA/core: Fix bogus WARN_ON during ib_unregister_device_queued()' \
    /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

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).