diff options
| author | Leon Romanovsky <[email protected]> | 2020-04-23 06:01:22 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2020-04-24 18:40:41 +0000 |
| commit | f0abc761bbb9418876cc4d1ebc473e4ea6352e42 (patch) | |
| tree | 3130425b974171526973c3d4b84eeeef919df68c /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | IB/rdmavt: Always return ERR_PTR from rvt_create_mmap_info() (diff) | |
| download | kernel-f0abc761bbb9418876cc4d1ebc473e4ea6352e42.tar.gz kernel-f0abc761bbb9418876cc4d1ebc473e4ea6352e42.zip | |
RDMA/core: Fix race between destroy and release FD object
The call to ->lookup_put() was too early and it caused an unlock of the
read/write protection of the uobject after the FD was put. This allows a
race:
CPU1 CPU2
rdma_lookup_put_uobject()
lookup_put_fd_uobject()
fput()
fput()
uverbs_uobject_fd_release()
WARN_ON(uverbs_try_lock_object(uobj,
UVERBS_LOOKUP_WRITE));
atomic_dec(usecnt)
Fix the code by changing the order, first unlock and call to
->lookup_put() after that.
Fixes: 3832125624b7 ("IB/core: Add support for idr types")
Link: https://lore.kernel.org/r/[email protected]
Suggested-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions
