]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: Fix unbalanced unlock on error path for rdma_explicit_destroy
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 13 Feb 2018 10:18:40 +0000 (12:18 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Feb 2018 22:31:26 +0000 (15:31 -0700)
commit0a201a5d172118c6004b5bda8d534b89bb80c5e4
tree89769f2e7b09a3a19973735b2801f984806c7c99
parenta3169975b51f8795778ed5dfdebf78958f9e4e06
IB/uverbs: Fix unbalanced unlock on error path for rdma_explicit_destroy

If remove_commit fails then the lock is left locked while the uobj still
exists. Eventually the kernel will deadlock.

lockdep detects this and says:

 test/4221 is leaving the kernel with locks still held!
 1 lock held by test/4221:
  #0:  (&ucontext->cleanup_rwsem){.+.+}, at: [<000000001e5c7523>] rdma_explicit_destroy+0x37/0x120 [ib_uverbs]

Fixes: 29032cf1931d ("IB/core: Explicitly destroy an object while keeping uobject")
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c