]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/vmw_pvrdma: Avoid use after free due to QP/CQ/SRQ destroy
authorBryan Tan <bryantan@vmware.com>
Wed, 20 Dec 2017 17:51:40 +0000 (09:51 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 21 Dec 2017 23:06:07 +0000 (16:06 -0700)
commit8cca9fa4f72bba405413c88bb0a87da99efbe54a
tree4ced0a83b6f8adcea83e478bfba004780ba71901
parent0c2e6ab70e6cbd1dc025f4c3abbf9dbdc4d1dc2e
RDMA/vmw_pvrdma: Avoid use after free due to QP/CQ/SRQ destroy

The use of wait queues in vmw_pvrdma for handling concurrent
access to a resource leaves a race condition which can cause a use
after free bug.

Fix this by using the pattern from other drivers, complete() protected by
dec_and_test to ensure complete() is called only once.

Fixes: 65cfc2528fa1 ("IB: Add vmw_pvrdma driver")
Signed-off-by: Bryan Tan <bryantan@vmware.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h
drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c