linux/drivers/infiniband
Leon Romanovsky f8978bd95c RDMA/netlink: Fix locking around __ib_get_device_by_index
Holding locks is mandatory when calling __ib_device_get_by_index,
otherwise there are races during the list iteration with device removal.

Since the locks are static to device.c, __ib_device_get_by_index can
never be called correctly by any user out side the file.

Make the function static and provide a safe function that gets the
correct locks and returns a kref'd pointer. Fix all callers.

Fixes: e5c9469efc ("RDMA/netlink: Add nldev device doit implementation")
Fixes: c3f66f7b00 ("RDMA/netlink: Implement nldev port doit callback")
Fixes: 7d02f605f0 ("RDMA/netlink: Add nldev port dumpit implementation")
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-01-02 14:11:40 -07:00
..
core RDMA/netlink: Fix locking around __ib_get_device_by_index 2018-01-02 14:11:40 -07:00
hw IB/mlx4: Fix mlx4_ib_alloc_mr error flow 2018-01-02 11:09:05 -07:00
sw Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
ulp IB/ipoib: Fix race condition in neigh creation 2018-01-02 11:09:05 -07:00
Kconfig IB: INFINIBAND should depend on HAS_DMA 2017-11-30 16:01:28 -07:00
Makefile IB/rdmavt: Create module framework and handle driver registration 2016-03-10 20:37:04 -05:00