Linux: Use After Free
CVE-2022-50219 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 3527e3cbb84d8868c4d4e91ba55915f96d39ec3d, 1f8ca9c40e6222ce431e9ba5dae3cccce8ef9443, 6336388715afa419cc97d0255bda3bba1b96b7ca 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.24% 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 3527e3cbb84d8868c4d4e91ba55915f96d39ec3d or 1f8ca9c40e6222ce431e9ba5dae3cccce8ef9443 or 6336388715afa419cc97d0255bda3bba1b96b7ca or be001f9da71eaa3b61e186fb88bde3279728bdca, whichever matches your release line, or a later version.
- Update Linux Kernel to 5.10.138 or 5.15.61 or 5.18.18 or 5.19.2, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | af6eea57437a830293eab56246b6025cc7d46ee7 up to, but not including, 3527e3cbb84d8868c4d4e91ba55915f96d39ec3d; af6eea57437a830293eab56246b6025cc7d46ee7 up to, but not including, 1f8ca9c40e6222ce431e9ba5dae3cccce8ef9443; af6eea57437a830293eab56246b6025cc7d46ee7 up to, but not including, 6336388715afa419cc97d0255bda3bba1b96b7ca; af6eea57437a830293eab56246b6025cc7d46ee7 up to, but not including, be001f9da71eaa3b61e186fb88bde3279728bdca; af6eea57437a830293eab56246b6025cc7d46ee7 up to, but not including, 4c46091ee985ae84c60c5e95055d779fcd291d87; 5.7 | 3527e3cbb84d8868c4d4e91ba55915f96d39ec3d, 1f8ca9c40e6222ce431e9ba5dae3cccce8ef9443, 6336388715afa419cc97d0255bda3bba1b96b7ca, be001f9da71eaa3b61e186fb88bde3279728bdca, 4c46091ee985ae84c60c5e95055d779fcd291d87 |
| Linux | Linux Kernel | 5.7 up to, but not including, 5.10.138; 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.10.138, 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: bpf: Fix KASAN use-after-free Read in compute_effective_progs Syzbot found a Use After Free bug in compute_effective_progs(). The reproducer creates a number of BPF links, and causes a fault injected alloc to fail, while calling bpf_link_detach on them. Link detach triggers the link to be freed by bpf_link_free(), which calls __cgroup_bpf_detach() and update_effective_progs(). If the memory allocation in this function fails, the function restores the pointer to the bpf_cgroup_link on the cgroup list, but the memory gets freed just after it returns. After this, every subsequent call to update_effective_progs() causes this already deallocated pointer to be dereferenced in prog_list_length(), and triggers KASAN UAF error. To fix this issue don't preserve the pointer to the prog or link in the list, but remove it and replace it with a dummy prog without shrinking the table. The subsequent call to __cgroup_bpf_detach() or __cgroup_bpf_detach() will correct it.
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/1f8ca9c40e6222ce431e9ba5dae3cccce8ef9443
- git.kernel.org/stable/c/3527e3cbb84d8868c4d4e91ba55915f96d39ec3d
- git.kernel.org/stable/c/4c46091ee985ae84c60c5e95055d779fcd291d87
- git.kernel.org/stable/c/6336388715afa419cc97d0255bda3bba1b96b7ca
- git.kernel.org/stable/c/be001f9da71eaa3b61e186fb88bde3279728bdca
Recent Use After Free vulnerabilities
- 8.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.