IB/mlx5: Fix potential deadlock in MR deregistration
Summary
IB/mlx5: Fix potential deadlock in MR deregistration
Original description
The description as published by the source.
In the Linux kernel, the following vulnerability has been resolved:
IB/mlx5: Fix potential deadlock in MR deregistration
The issue arises when kzalloc() is invoked while holding umem_mutex or
any other lock acquired under umem_mutex. This is problematic because
kzalloc() can trigger fs_reclaim_aqcuire(), which may, in turn, invoke
mmu_notifier_invalidate_range_start(). This function can lead to
mlx5_ib_invalidate_range(), which attempts to acquire umem_mutex again,
resulting in a deadlock.
The problematic flow:
| CPU0 | CPU1 |
|---|---|
| mlx5_ib_dereg_mr() | |
| → revoke_mr() | |
| → mutex_lock(&umem_odp->umem_mutex) | |
| mlx5_mkey_cache_init() | |
| → mutex_lock(&dev->cache.rb_lock) | |
| → mlx5r_cache_create_ent_locked() | |
| → kzalloc(GFP_KERNEL) | |
| → fs_reclaim() | |
| → mmu_notifier_invalidate_range_start() | |
| → mlx5_ib_invalidate_range() | |
| → mutex_lock(&umem_odp->umem_mutex) | |
| → cache_ent_find_and_store() | |
| → mutex_lock(&dev->cache.rb_lock) |
Additionally, when kzalloc()…
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- BellSoft Alpaquita BELL-CVE-2025-38373 linux-lts Fixed in: 6.12.41-r0
- Debian DEBIAN-CVE-2025-38373 linux Fixed in: 6.12.37-1
- Ubuntu UBUNTU-CVE-2025-38373 linux
References
- advisory github.com
- advisory nvd.nist.gov
- package git.kernel.org
- web git.kernel.org
- web git.kernel.org
- web git.kernel.org