Linux: Use After Free
CVE-2024-42104 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 c33c2b0d92aa1c2262d999b2598ad6fbd53bd479, 07c176e7acc5579c133bb923ab21316d192d0a95, 2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7 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.
High severity with no evidence of exploitation so far.
What to do
- Update Linux to c33c2b0d92aa1c2262d999b2598ad6fbd53bd479 or 07c176e7acc5579c133bb923ab21316d192d0a95 or 2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7 or b11e8fb93ea5eefb2e4e719497ea177a58ff6131, whichever matches your release line, or a later version.
- 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
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, c33c2b0d92aa1c2262d999b2598ad6fbd53bd479; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 07c176e7acc5579c133bb923ab21316d192d0a95; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, b11e8fb93ea5eefb2e4e719497ea177a58ff6131; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 1b7d549ed2c1fa202c751b69423a0d3a6bd5a180; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 3ab40870edb883b9633dc5cd55f5a2a11afa618d; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 265fff1a01cdc083aeaf0d934c929db5cc64aebf; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, bb76c6c274683c8570ad788f79d4b875bde0e458; and 1 more ranges | c33c2b0d92aa1c2262d999b2598ad6fbd53bd479, 07c176e7acc5579c133bb923ab21316d192d0a95, 2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7, b11e8fb93ea5eefb2e4e719497ea177a58ff6131, 1b7d549ed2c1fa202c751b69423a0d3a6bd5a180, 3ab40870edb883b9633dc5cd55f5a2a11afa618d |
| Linux | Linux Kernel | before 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 | 4.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 system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.8 | High | CNA |
| CVSS 3.1 | 7.8 | High | NVD |
Official description
In the Linux kernel, the following vulnerability has been resolved: nilfs2: add missing check for inode numbers on directory entries Syzbot reported that mounting and unmounting a specific pattern of corrupted nilfs2 filesystem images causes a use-after-free of metadata file inodes, which triggers a kernel bug in lru_add_fn(). As Jan Kara pointed out, this is because the link count of a metadata file gets corrupted to 0, and nilfs_evict_inode(), which is called from iput(), tries to delete that inode (ifile inode in this case). The inconsistency occurs because directories containing the inode numbers of these metadata files that should not be visible in the namespace are read without checking. Fix this issue by treating the inode numbers of these internal files as errors in the sanity check helper when reading directory folios/pages. Also thanks to Hillf Danton and Matthew Wilcox for their initial mm-layer analysis.
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.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- git.kernel.org/stable/c/07c176e7acc5579c133bb923ab21316d192d0a95
- git.kernel.org/stable/c/1b7d549ed2c1fa202c751b69423a0d3a6bd5a180
- git.kernel.org/stable/c/265fff1a01cdc083aeaf0d934c929db5cc64aebf
- git.kernel.org/stable/c/2f2fa9cf7c3537958a82fbe8c8595a5eb0861ad7
- git.kernel.org/stable/c/3ab40870edb883b9633dc5cd55f5a2a11afa618d
- git.kernel.org/stable/c/b11e8fb93ea5eefb2e4e719497ea177a58ff6131
- git.kernel.org/stable/c/bb76c6c274683c8570ad788f79d4b875bde0e458
- git.kernel.org/stable/c/c33c2b0d92aa1c2262d999b2598ad6fbd53bd479
Other references
Recent Use After Free vulnerabilities
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
Spotted an error? Tell us.