bianbu-linux-6.6/drivers/infiniband/hw
Jason Gunthorpe 22fa27fbc6 IB/uverbs: Fix locking around struct ib_uverbs_file ucontext
We have a parallel unlocked reader and writer with ib_uverbs_get_context()
vs everything else, and nothing guarantees this works properly.

Audit and fix all of the places that access ucontext to use one of the
following locking schemes:
- Call ib_uverbs_get_ucontext() under SRCU and check for failure
- Access the ucontext through an struct ib_uobject context member
  while holding a READ or WRITE lock on the uobject.
  This value cannot be NULL and has no race.
- Hold the ucontext_lock and check for ufile->ucontext !NULL

This also re-implements ib_uverbs_get_ucontext() in a way that is safe
against concurrent ib_uverbs_get_context() and disassociation.

As a side effect, every access to ucontext in the commands is via
ib_uverbs_get_context() with an error check, or via the uobject, so there
is no longer any need for the core code to check ucontext on every command
call. These checks are also removed.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-07-25 14:21:46 -06:00
..
bnxt_re RDMA/bnxt_re: Modify a fall-through annotation 2018-07-23 15:36:23 -06:00
cxgb3 RDMA/cxgb3: Make iwch_poll_cq_one() easier to analyze 2018-07-09 12:55:28 -06:00
cxgb4 rdma/cxgb4: Add support for 64Byte cqes 2018-07-13 11:52:55 -06:00
hfi1 IB/hfi1: Suppress a compiler warning 2018-07-11 14:20:45 -06:00
hns hns: Remove a set-but-not-used variable 2018-07-11 14:21:52 -06:00
i40iw infiniband: i40iw, nes: don't use wall time for TCP sequence numbers 2018-07-11 12:10:19 -06:00
mlx4 RDMA: Fix storage of PortInfo CapabilityMask in the kernel 2018-07-10 11:06:45 -06:00
mlx5 IB/uverbs: Fix locking around struct ib_uverbs_file ucontext 2018-07-25 14:21:46 -06:00
mthca IB/core: add max_send_sge and max_recv_sge attributes 2018-06-18 13:17:28 -06:00
nes infiniband: i40iw, nes: don't use wall time for TCP sequence numbers 2018-07-11 12:10:19 -06:00
ocrdma RDMA/ocrdma: Make ocrdma_destroy_qp() easier to analyze 2018-07-11 12:12:57 -06:00
qedr RDMA: Fix storage of PortInfo CapabilityMask in the kernel 2018-07-10 11:06:45 -06:00
qib RDMA: Fix storage of PortInfo CapabilityMask in the kernel 2018-07-10 11:06:45 -06:00
usnic IB/usnic: Update with bug fixes from core code 2018-06-25 14:38:28 -06:00
vmw_pvrdma RDMA: Fix storage of PortInfo CapabilityMask in the kernel 2018-07-10 11:06:45 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00