Skip to contentSkip to conversation

CVE-2025-40255: net: core: prevent NULL deref in generic_hwtstamp_ioctl_lower()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 4, 2025

lore
Share & tools
lore
#0 lore raw

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

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

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

net: core: prevent NULL deref in generic_hwtstamp_ioctl_lower()

The ethtool tsconfig Netlink path can trigger a null pointer dereference. A call chain such as:

tsconfig_prepare_data() ->
dev_get_hwtstamp_phylib() ->
vlan_hwtstamp_get() ->
generic_hwtstamp_get_lower() ->
generic_hwtstamp_ioctl_lower()

results in generic_hwtstamp_ioctl_lower() being called with kernel_cfg->ifr as NULL.

The generic_hwtstamp_ioctl_lower() function does not expect a NULL ifr and dereferences it, leading to a system crash.

Fix this by adding a NULL check for kernel_cfg->ifr in generic_hwtstamp_ioctl_lower(). If ifr is NULL, return -EINVAL.

The Linux kernel CVE team has assigned CVE-2025-40255 to this issue.

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

	Issue introduced in 6.14 with commit 6e9e2eed4f39d52edf5fd006409d211facf49f6b and fixed in 6.17.10 with commit 8817f816ae41908e9625c0770c4af0dcdcc01238
	Issue introduced in 6.14 with commit 6e9e2eed4f39d52edf5fd006409d211facf49f6b and fixed in 6.18 with commit f796a8dec9beafcc0f6f0d3478ed685a15c5e062

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-2025-40255

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/core/dev_ioctl.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/8817f816ae41908e9625c0770c4af0dcdcc01238
	https://git.kernel.org/stable/c/f796a8dec9beafcc0f6f0d3478ed685a15c5e062