2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/infiniband/core
Or Har-Toov 3f5f6321f1 IB/core: Annotate umem_mutex acquisition under fs_reclaim for lockdep
Following the fix in the previous commit ("IB/mlx5: Fix potential
deadlock in MR deregistration"), teach lockdep explicitly about the
locking order between fs_reclaim and umem_mutex.

The previous commit resolved a potential deadlock scenario where
kzalloc(GFP_KERNEL) was called while holding umem_mutex, which could
lead to reclaim and eventually invoke the MMU notifier
(mlx5_ib_invalidate_range()), causing a recursive acquisition of
umem_mutex.

To prevent such issues from reoccurring unnoticed in future code
changes, add a lockdep annotation in ib_init_umem_odp() that simulates
taking umem_mutex inside a reclaim context. This makes lockdep aware
of this locking dependency and ensures that future violations—such as
calling kzalloc() or any memory allocator that may enter reclaim while
holding umem_mutex—will immediately raise a lockdep warning.

Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
Link: https://patch.msgid.link/9d31b9d8fe1db648a9f47cec3df6b8463319dee5.1750061698.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-06-25 03:40:16 -04:00
..
addr.c Revert "RDMA/core: Fix ENODEV error for iWARP test over vlan" 2024-11-12 09:53:11 -05:00
agent.c RDMA/core: Create GSI QP only when CM is supported 2024-07-01 15:38:05 +03:00
agent.h
cache.c RDMA/core: Rate limit GID cache warning messages 2025-06-17 14:14:53 -03:00
cgroup.c
cm_msgs.h
cm_trace.c
cm_trace.h IB/cm: Remove dead code and adjust naming 2025-05-25 06:24:21 -04:00
cm.c IB/cm: Remove dead code and adjust naming 2025-05-25 06:24:21 -04:00
cma_configfs.c RDMA/cma: Fix truncation compilation warning in make_cma_ports 2023-09-18 11:52:10 +03:00
cma_priv.h RDMA/core: Add an rb_tree that stores cm_ids sorted by ifindex and remote IP 2022-06-16 09:54:35 +03:00
cma_trace.c
cma_trace.h IB/cm: Remove dead code and adjust naming 2025-05-25 06:24:21 -04:00
cma.c RDMA/cma: Fix hang when cma_netevent_callback fails to queue_work 2025-05-26 15:36:46 -03:00
core_priv.h RDMA/core: Remove unused declaration rdma_resolve_ip_route() 2024-08-19 15:19:52 -03:00
counters.c RDMA/core: Pass port to counter bind/unbind operations 2025-03-18 06:18:46 -04:00
cq.c RDMA/core: Delete useless module.h include 2022-01-28 13:03:12 -04:00
device.c RDMA/core: Fix "KASAN: slab-use-after-free Read in ib_register_device" problem 2025-05-06 14:36:57 -03:00
ib_core_uverbs.c
iwcm.c RDMA/iwcm: Fix use-after-free of work objects after cm_id destruction 2025-05-13 07:08:37 -04:00
iwcm.h
iwpm_msg.c
iwpm_util.c RDMA: Remove unnecessary NULL values 2023-08-07 16:56:57 +03:00
iwpm_util.h RDMA/core: Delete useless module.h include 2022-01-28 13:03:12 -04:00
lag.c RDMA/core: Remove NULL check before dev_{put, hold} 2024-05-05 15:12:35 +03:00
mad_priv.h
mad_rmpp.c RDMA/core: Convert to use ERR_CAST() 2025-04-07 15:12:06 -03:00
mad_rmpp.h
mad.c IB/mad: Check available slots before posting receive WRs 2025-03-19 04:43:03 -04:00
Makefile RDMA/uverbs: Introduce UCAP (User CAPabilities) API 2025-03-09 13:13:02 -04:00
mr_pool.c
multicast.c
netlink.c RDMA/nldev: Add support for RDMA monitoring 2024-09-13 08:29:14 +03:00
nldev.c RDMA/core: Add support to optional-counters binding configuration 2025-03-18 06:18:42 -04:00
opa_smi.h
packer.c
rdma_core.c RDMA/core: Move ib_uverbs_file struct to uverbs_types.h 2024-11-04 06:57:21 -05:00
rdma_core.h
restrack.c RDMA/core: Add an option to display driver-specific QPs in the rdmatool 2024-04-30 11:19:29 +03:00
restrack.h
roce_gid_mgmt.c RDMA/core: Implement RoCE GID port rescan and export delete function 2024-11-04 06:57:21 -05:00
rw.c RDMA/core: Fix a couple of obvious typos in comments 2023-10-04 21:55:44 +03:00
sa_query.c treewide: correct the typo 'retun' 2024-09-09 16:47:43 -07:00
sa.h
security.c
smi.c
smi.h
sysfs.c RDMA/core: Don't expose hw_counters outside of init net namespace 2025-03-03 07:14:48 -05:00
trace.c
ucaps.c RDMA/ucaps: Avoid format-security warning 2025-04-07 14:55:32 -03:00
ucma.c RDMA/core: Fixes infiniband sysctl bounds 2025-03-03 13:49:02 -05:00
ud_header.c RDMA/core: Remove unused ib_ud_header_unpack 2024-12-24 05:00:42 -05:00
umem_dmabuf.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
umem_odp.c IB/core: Annotate umem_mutex acquisition under fs_reclaim for lockdep 2025-06-25 03:40:16 -04:00
umem.c RDMA/core: Fix best page size finding when it can cross SG entries 2025-02-19 07:17:39 -05:00
user_mad.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
uverbs_cmd.c RDMA/uverbs: Convert to use ERR_CAST() 2025-04-07 15:12:07 -03:00
uverbs_ioctl.c RDMA/uverbs: Avoid -Wflex-array-member-not-at-end warnings 2024-03-03 15:38:44 +02:00
uverbs_main.c RDMA/uverbs: Introduce UCAP (User CAPabilities) API 2025-03-09 13:13:02 -04:00
uverbs_marshall.c RDMA/core: Remove unused ib_copy_path_rec_from_user 2024-12-24 05:00:42 -05:00
uverbs_std_types_async_fd.c
uverbs_std_types_counters.c IB/uverbs: Fix an potential error pointer dereference 2023-08-07 16:49:59 +03:00
uverbs_std_types_cq.c RDMA: Pass entire uverbs attr bundle to create cq function 2024-06-27 16:28:21 -03:00
uverbs_std_types_device.c RDMA/uverbs: Add support for UCAPs in context creation 2025-03-09 13:13:02 -04:00
uverbs_std_types_dm.c
uverbs_std_types_flow_action.c RDMA/core: Delete IPsec flow action logic from the core 2022-04-09 08:25:06 +03:00
uverbs_std_types_mr.c RDMA: Pass uverbs_attr_bundle as part of '.reg_user_mr_dmabuf' API 2024-08-11 11:12:50 +03:00
uverbs_std_types_qp.c IB/uverbs: fix the typo of optional 2022-10-19 09:46:45 +03:00
uverbs_std_types_srq.c
uverbs_std_types_wq.c
uverbs_std_types.c
uverbs_uapi.c RDMA/uverbs: Check for null return of kmalloc_array 2022-01-05 14:16:53 -04:00
uverbs.h RDMA/core: Move ib_uverbs_file struct to uverbs_types.h 2024-11-04 06:57:21 -05:00
verbs.c RDMA/core: Convert to use ERR_CAST() 2025-04-07 15:12:07 -03:00