linux/drivers/infiniband/core
Jason Gunthorpe 691081c055 RDMA/core: Fix bogus WARN_ON during ib_unregister_device_queued()
[ Upstream commit 0cb42c0265 ]

ib_unregister_device_queued() can only be used by drivers using the new
dealloc_device callback flow, and it has a safety WARN_ON to ensure
drivers are using it properly.

However, if unregister and register are raced there is a special
destruction path that maintains the uniform error handling semantic of
'caller does ib_dealloc_device() on failure'. This requires disabling the
dealloc_device callback which triggers the WARN_ON.

Instead of using NULL to disable the callback use a special function
pointer so the WARN_ON does not trigger.

Fixes: d0899892ed ("RDMA/device: Provide APIs from the core code to help unregistration")
Link: https://lore.kernel.org/r/0-v1-a36d512e0a99+762-syz_dealloc_driver_jgg@nvidia.com
Reported-by: syzbot+4088ed905e4ae2b0e13b@syzkaller.appspotmail.com
Suggested-by: Hillf Danton <hdanton@sina.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:16:09 +02:00
..
Makefile
addr.c
agent.c
agent.h
cache.c IB/core: Fix potential NULL pointer dereference in pkey cache 2020-05-20 08:20:26 +02:00
cgroup.c
cm.c RDMA/cm: Fix an error check in cm_alloc_id_priv() 2020-05-06 08:15:13 +02:00
cm_msgs.h
cma.c RDMA/cma: Protect bind_list and listen_list while finding matching cm id 2020-06-30 15:36:57 -04:00
cma_configfs.c IB/cma: Fix ports memory leak in cma_configfs 2020-06-24 17:50:32 +02:00
cma_priv.h
core_priv.h RDMA/core: Fix protection fault in ib_mr_pool_destroy 2020-03-12 13:00:29 +01:00
counters.c RDMA/counter: Query a counter before release 2020-07-09 09:37:52 +02:00
cq.c
device.c RDMA/core: Fix bogus WARN_ON during ib_unregister_device_queued() 2020-08-19 08:16:09 +02:00
fmr_pool.c
iwcm.c RDMA/iwcm: Fix iwcm work deallocation 2020-03-12 13:00:29 +01:00
iwcm.h
iwpm_msg.c
iwpm_util.c
iwpm_util.h
mad.c RDMA/mad: Fix possible memory leak in ib_mad_post_receive_mads() 2020-06-30 15:36:58 -04:00
mad_priv.h
mad_rmpp.c
mad_rmpp.h
mr_pool.c
multicast.c
netlink.c
nldev.c RDMA/core: Fix double put of resource 2020-05-20 08:20:26 +02:00
opa_smi.h
packer.c
rdma_core.c RDMA/core: Fix double destruction of uobject 2020-06-03 08:21:25 +02:00
rdma_core.h
restrack.c
restrack.h
roce_gid_mgmt.c
rw.c RDMA/rw: Fix error flow during RDMA context initialization 2020-03-12 13:00:29 +01:00
sa.h
sa_query.c IB/sa: Resolv use-after-free in ib_nl_make_request() 2020-07-16 08:16:38 +02:00
security.c RDMA/core: Ensure security pkey modify is not lost 2020-04-01 11:02:04 +02:00
smi.c
smi.h
sysfs.c RDMA/core: Fix several reference count leaks. 2020-06-24 17:50:17 +02:00
ucma.c RDMA/ucma: Put a lock around every call to the rdma_cm layer 2020-04-13 10:48:12 +02:00
ud_header.c
umem.c
umem_odp.c
user_mad.c RDMA/mad: Do not crash if the rdma device does not have a umad interface 2020-04-01 11:01:58 +02:00
uverbs.h
uverbs_cmd.c RDMA/core: Fix protection fault in ib_mr_pool_destroy 2020-03-12 13:00:29 +01:00
uverbs_ioctl.c
uverbs_main.c RDMA/uverbs: Make the event_queue fds return POLLERR when disassociated 2020-06-17 16:40:22 +02:00
uverbs_marshall.c
uverbs_std_types.c
uverbs_std_types_counters.c
uverbs_std_types_cq.c
uverbs_std_types_device.c
uverbs_std_types_dm.c
uverbs_std_types_flow_action.c
uverbs_std_types_mr.c
uverbs_uapi.c
verbs.c RDMA/core: Fix protection fault in ib_mr_pool_destroy 2020-03-12 13:00:29 +01:00