PT-2024-7046 · Linux+10 · Linux Kernel+10

Published

2024-06-18

·

Updated

2025-09-29

·

CVE-2024-40958

CVSS v3.1

7.8

High

VectorAV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Linux kernel versions prior to 6.10.0-rc3
Description The vulnerability is related to the get net ns() function in the Linux kernel, which fails to handle a zero refcount net. This can lead to a use-after-free condition, causing a kernel panic. The issue is triggered when the tun set iff() function is called with a device set to tun0, followed by setting the network namespace of tun0 to ns1 and then putting the network reference count to zero. The tun chr ioctl() function is then called with the TUNGETDEVNETNS command, which attempts to access the network namespace, resulting in a kernel panic.
Recommendations To resolve this issue, update the Linux kernel to a version that includes the fix for the get net ns() function. Alternatively, as a temporary workaround, consider disabling the tun module or restricting access to the TUNGETDEVNETNS command until a patched kernel is available.
Note: The provided information does not specify the exact version that includes the fix, so it is recommended to update to the latest available kernel version.

Exploit

Fix

DoS

Use After Free

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALSA-2024:5363
ALSA-2024:7000
ALSA-2024:7001
ALSA-2025_16880
ALT-PU-2024-12537
ALT-PU-2024-13979
ALT-PU-2024-14046
ALT-PU-2024-9967
BDU:2024-08304
CESA-2024_7000
CESA-2024_7001
CVE-2024-40958
DLA-4008-1
DSA-5730-1
DSA-5731-1
INFSA-2024_5363
INFSA-2024_7000
INFSA-2024_7001
OESA-2024-2292
OESA-2024-2293
OESA-2024-2295
OESA-2024-2590
OPENSUSE-SU-2024_2947-1
RHSA-2024:5363
RHSA-2024:7000
RHSA-2024:7001
RHSA-2024_5363
RHSA-2024_7000
RHSA-2024_7001
RLSA-2024:5363
RLSA-2024:7001
SUSE-SU-2024:2894-1
SUSE-SU-2024:2939-1
SUSE-SU-2024:2947-1
SUSE-SU-2024:3194-1
SUSE-SU-2024:3195-1
SUSE-SU-2024:3383-1
SUSE-SU-2025:20044-1
SUSE-SU-2025:20047-1
USN-6999-1
USN-6999-2
USN-7003-1
USN-7003-2
USN-7003-3
USN-7003-4
USN-7003-5
USN-7004-1
USN-7005-1
USN-7005-2
USN-7006-1
USN-7007-1
USN-7007-2
USN-7007-3
USN-7008-1
USN-7009-1
USN-7009-2
USN-7019-1
USN-7029-1

Affected Products

Alt Linux
Almalinux
Astra Linux
Centos
Linuxmint
Linux Kernel
Red Hat
Red Os
Rocky Linux
Suse
Ubuntu