Skip to contentSkip to conversation

CVE-2026-31673: af_unix: read UNIX_DIAG_VFS data under unix_state_lock

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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

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

af_unix: read UNIX_DIAG_VFS data under unix_state_lock

Exact UNIX diag lookups hold a reference to the socket, but not to u->path. Meanwhile, unix_release_sock() clears u->path under unix_state_lock() and drops the path reference after unlocking.

Read the inode and device numbers for UNIX_DIAG_VFS while holding unix_state_lock(), then emit the netlink attribute after dropping the lock.

This keeps the VFS data stable while the reply is being built.

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

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

	Issue introduced in 3.3 with commit 5f7b0569460b7d8d01ca776430a00505a68b7584 and fixed in 6.12.83 with commit 0c739f3785f84af695952c2bac8be2f45082c9b8
	Issue introduced in 3.3 with commit 5f7b0569460b7d8d01ca776430a00505a68b7584 and fixed in 6.18.24 with commit 900a4e0910e98b8caef117d5df00471fa438dcf9
	Issue introduced in 3.3 with commit 5f7b0569460b7d8d01ca776430a00505a68b7584 and fixed in 6.19.14 with commit bdf206e740bf2919d818f132c8c9cc7ed91d11c0
	Issue introduced in 3.3 with commit 5f7b0569460b7d8d01ca776430a00505a68b7584 and fixed in 7.0 with commit 39897df386376912d561d4946499379effa1e7ef

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-31673

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:
net/unix/diag.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/0c739f3785f84af695952c2bac8be2f45082c9b8
	https://git.kernel.org/stable/c/900a4e0910e98b8caef117d5df00471fa438dcf9
	https://git.kernel.org/stable/c/bdf206e740bf2919d818f132c8c9cc7ed91d11c0
	https://git.kernel.org/stable/c/39897df386376912d561d4946499379effa1e7ef