]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
RDMA/core: Fix locking in ib_uverbs_event_read
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 8 Jan 2020 17:22:03 +0000 (19:22 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:31:00 +0000 (00:31 -0400)
commitbd0b0a07181750572d7dc31f6b1f1f8276edd22d
treeb00d3a20d087d44c5c2683ecfcc3f80733afa47f
parent5c45f671c08b48aaa05f067b94f6f9d4979db9bd
RDMA/core: Fix locking in ib_uverbs_event_read

BugLink: https://bugs.launchpad.net/bugs/1867194
commit 14e23bd6d22123f6f3b2747701fa6cd4c6d05873 upstream.

This should not be using ib_dev to test for disassociation, during
disassociation is_closed is set under lock and the waitq is triggered.

Instead check is_closed and be sure to re-obtain the lock to test the
value after the wait_event returns.

Fixes: 036b10635739 ("IB/uverbs: Enable device removal when there are active user space applications")
Link: https://lore.kernel.org/r/1578504126-9400-12-git-send-email-yishaih@mellanox.com
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/core/uverbs_main.c