Categories
CVE-2025-38373

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()…

Source: OSV.dev (Open Source Vulnerabilities) NVD OSV

Affected packages

Linux Kernel
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.12.37"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.15.6"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details