CVE-2026-74395: RDMA/mlx5: Fix devx subscribe-event unwind NULL dereference

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026081508-CVE-2026-74395-4139@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

RDMA/mlx5: Fix devx subscribe-event unwind NULL dereference

MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT() links event_sub into sub_list
before initializing the fields used by the shared error path.

If eventfd_ctx_fdget() then fails, the unwind path dereferences
event_sub->ev_file in uverbs_uobject_put() and calls
subscribe_event_xa_dealloc() with an unset xa_key_level1.

subscribe_event_xa_alloc() creates the XA entry exactly once for a given
key_level1, on the first occurrence of that key. The unwind path must
therefore call subscribe_event_xa_dealloc() exactly once for it as well.

Enforce that by adding devx_key_in_sub_list() and calling
subscribe_event_xa_dealloc() only when the last matching pending entry is
being cleaned up.

The Linux kernel CVE team has assigned CVE-2026-74395 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 5.10.261 with commit 6e15b770461eeaa0ff73934922cb670a6a9db04e
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 5.15.212 with commit 9be9aca28424228586fe9211c373ebdb826ebb6c
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 6.1.178 with commit f345e744b6b087188cde2377da5cbe9713b61353
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 6.6.145 with commit 1025dc2f7ba29b04b8687790fa91f9cd1a53141e
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 6.12.97 with commit 7921821fc2b19c01588311f6e7468ae5b68b1f61
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 6.18.40 with commit 5100febf8e9d6c8c5ba8dc6534c6a5e3376e5989
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 7.1.5 with commit 78b9589fda266c71f0f9d0c858d4fa7381a890a5
	Issue introduced in 5.3 with commit 7597385371425febdaa8c6a1da3625d4ffff16f5 and fixed in 7.2-rc1 with commit 43f8f7946814c8e5f464518246fdbc69b6e32326

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-74395
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	drivers/infiniband/hw/mlx5/devx.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/6e15b770461eeaa0ff73934922cb670a6a9db04e
	https://git.kernel.org/stable/c/9be9aca28424228586fe9211c373ebdb826ebb6c
	https://git.kernel.org/stable/c/f345e744b6b087188cde2377da5cbe9713b61353
	https://git.kernel.org/stable/c/1025dc2f7ba29b04b8687790fa91f9cd1a53141e
	https://git.kernel.org/stable/c/7921821fc2b19c01588311f6e7468ae5b68b1f61
	https://git.kernel.org/stable/c/5100febf8e9d6c8c5ba8dc6534c6a5e3376e5989
	https://git.kernel.org/stable/c/78b9589fda266c71f0f9d0c858d4fa7381a890a5
	https://git.kernel.org/stable/c/43f8f7946814c8e5f464518246fdbc69b6e32326
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.