Linux: Use After Free
CVE-2022-50240 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 27a594bc7a7c8238d239e3cdbcf2edfa3bbe9a1b, 015ac18be7de25d17d6e5f1643cb3b60bfbe859e, 622ef885a89ad04cfb76ee478fb44f051125d1f1 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.17% 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 27a594bc7a7c8238d239e3cdbcf2edfa3bbe9a1b or 015ac18be7de25d17d6e5f1643cb3b60bfbe859e or 622ef885a89ad04cfb76ee478fb44f051125d1f1 or 925e6b6f82c9c80ab3c17acbde8d16f349da7d26, whichever matches your release line, or a later version.
- Update Linux Kernel to 5.4.224 or 5.10.154 or 5.15.61 or 5.18.18, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | dd2283f2605e3b3e9c61bcae844b34f2afa4813f up to, but not including, 27a594bc7a7c8238d239e3cdbcf2edfa3bbe9a1b; dd2283f2605e3b3e9c61bcae844b34f2afa4813f up to, but not including, 015ac18be7de25d17d6e5f1643cb3b60bfbe859e; dd2283f2605e3b3e9c61bcae844b34f2afa4813f up to, but not including, 622ef885a89ad04cfb76ee478fb44f051125d1f1; dd2283f2605e3b3e9c61bcae844b34f2afa4813f up to, but not including, 925e6b6f82c9c80ab3c17acbde8d16f349da7d26; dd2283f2605e3b3e9c61bcae844b34f2afa4813f up to, but not including, 1ec3f76a436d750fd5023caec5da0494fc2870d2; dd2283f2605e3b3e9c61bcae844b34f2afa4813f up to, but not including, a43cfc87caaf46710c8027a8c23b8a55f1078f19; 4.20 | 27a594bc7a7c8238d239e3cdbcf2edfa3bbe9a1b, 015ac18be7de25d17d6e5f1643cb3b60bfbe859e, 622ef885a89ad04cfb76ee478fb44f051125d1f1, 925e6b6f82c9c80ab3c17acbde8d16f349da7d26, 1ec3f76a436d750fd5023caec5da0494fc2870d2, a43cfc87caaf46710c8027a8c23b8a55f1078f19 |
| Linux | Linux Kernel | 4.20 up to, but not including, 5.4.224; 5.5 up to, but not including, 5.10.154; 5.11 up to, but not including, 5.15.61; 5.16 up to, but not including, 5.18.18; 5.19 up to, but not including, 5.19.2 | 5.4.224, 5.10.154, 5.15.61, 5.18.18, 5.19.2 |
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: android: binder: stop saving a pointer to the VMA Do not record a pointer to a VMA outside of the mmap_lock for later use. This is unsafe and there are a number of failure paths *after* the recorded VMA pointer may be freed during setup. There is no callback to the driver to clear the saved pointer from generic mm code. Furthermore, the VMA pointer may become stale if any number of VMA operations end up freeing the VMA so saving it was fragile to being with. Instead, change the binder_alloc struct to record the start address of the VMA and use vma_lookup() to get the vma when needed. Add lockdep mmap_lock checks on updates to the vma pointer to ensure the lock is held and depend on that lock for synchronization of readers and writers - which was already the case anyways, so the smp_wmb()/smp_rmb() was not necessary. [[email protected]: fix drivers/android/binder_alloc_selftest.c]
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.
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- git.kernel.org/stable/c/015ac18be7de25d17d6e5f1643cb3b60bfbe859e
- git.kernel.org/stable/c/1ec3f76a436d750fd5023caec5da0494fc2870d2
- git.kernel.org/stable/c/27a594bc7a7c8238d239e3cdbcf2edfa3bbe9a1b
- git.kernel.org/stable/c/622ef885a89ad04cfb76ee478fb44f051125d1f1
- git.kernel.org/stable/c/925e6b6f82c9c80ab3c17acbde8d16f349da7d26
- git.kernel.org/stable/c/a43cfc87caaf46710c8027a8c23b8a55f1078f19
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.