CyberSecBulletin
CVE-2024-42105NVD status: Modified

Linux: Use After Free

CVE-2024-42105 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 57235c3c88bb430043728d0d02f44a4efe386476, 08cab183a624ba71603f3754643ae11cab34dbc4, 731011ac6c37cbe97ece229fc6daa486276052c5 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.26% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 57235c3c88bb430043728d0d02f44a4efe386476 or 08cab183a624ba71603f3754643ae11cab34dbc4 or 731011ac6c37cbe97ece229fc6daa486276052c5 or 3be4dcc8d7bea52ea41f87aa4bbf959efe7a5987, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.318 or 5.4.280 or 5.10.222 or 5.15.163, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, 57235c3c88bb430043728d0d02f44a4efe386476; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, 08cab183a624ba71603f3754643ae11cab34dbc4; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, 731011ac6c37cbe97ece229fc6daa486276052c5; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, 3be4dcc8d7bea52ea41f87aa4bbf959efe7a5987; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, fae1959d6ab2c52677b113935e36ab4e25df37ea; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, 9194f8ca57527958bee207919458e372d638d783; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, 1c91058425a01131ea30dda6cf43c67b17884d6a; 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f up to, but not including, e2fec219a36e0993642844be0f345513507031f4; and 1 more ranges57235c3c88bb430043728d0d02f44a4efe386476, 08cab183a624ba71603f3754643ae11cab34dbc4, 731011ac6c37cbe97ece229fc6daa486276052c5, 3be4dcc8d7bea52ea41f87aa4bbf959efe7a5987, fae1959d6ab2c52677b113935e36ab4e25df37ea, 9194f8ca57527958bee207919458e372d638d783
LinuxLinux Kernelbefore 4.19.318; 4.20 up to, but not including, 5.4.280; 5.5 up to, but not including, 5.10.222; 5.11 up to, but not including, 5.15.163; 5.16 up to, but not including, 6.1.98; 6.2 up to, but not including, 6.6.39; 6.7 up to, but not including, 6.9.9; 6.104.19.318, 5.4.280, 5.10.222, 5.15.163, 6.1.98, 6.6.39

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

Official description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix inode number range checks Patch series "nilfs2: fix potential issues related to reserved inodes". This series fixes one use-after-free issue reported by syzbot, caused by nilfs2's internal inode being exposed in the namespace on a corrupted filesystem, and a couple of flaws that cause problems if the starting number of non-reserved inodes written in the on-disk super block is intentionally (or corruptly) changed from its default value. This patch (of 3): In the current implementation of nilfs2, "nilfs->ns_first_ino", which gives the first non-reserved inode number, is read from the superblock, but its lower limit is not checked. As a result, if a number that overlaps with the inode number range of reserved inodes such as the root directory or metadata files is set in the super block parameter, the inode number test macros (NILFS_MDT_INODE and NILFS_VALID_INODE) will not function properly. In addition, these test macros use left bit-shift calculations using with the inode number as the shift count via the BIT macro, but the result of a shift calculation that exceeds the bit width of an integer is undefined in the C specification, so if "ns_first_ino" is set to a large value other than the default value NILFS_USER_INO (=11), the macros may potentially malfunction depending on the environment. Fix these issues by checking the lower bound of "nilfs->ns_first_ino" and by preventing bit shifts equal to or greater than the NILFS_USER_INO constant in the inode number test macros. Also, change the type of "ns_first_ino" from signed integer to unsigned integer to avoid the need for type casting in comparisons such as the lower bound check introduced this time.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.