Linux: Use After Free
CVE-2022-48733 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 7e4c72dbaf62f8978af8321a24dbd35566d3a78a, a7b717fa15165d3d9245614680bebc48a52ac05d, 9372fa1d73da5f1673921e365d0cd2c27ec7adc2 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.23% 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 7e4c72dbaf62f8978af8321a24dbd35566d3a78a or a7b717fa15165d3d9245614680bebc48a52ac05d or 9372fa1d73da5f1673921e365d0cd2c27ec7adc2 or 28b21c558a3753171097193b6f6602a94169093a, whichever matches your release line, or a later version.
- Update Linux Kernel to 5.10.226 or 5.15.22 or 5.16.8, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2 up to, but not including, 7e4c72dbaf62f8978af8321a24dbd35566d3a78a; c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2 up to, but not including, a7b717fa15165d3d9245614680bebc48a52ac05d; c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2 up to, but not including, 9372fa1d73da5f1673921e365d0cd2c27ec7adc2; c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2 up to, but not including, 28b21c558a3753171097193b6f6602a94169093a; 3.7 | 7e4c72dbaf62f8978af8321a24dbd35566d3a78a, a7b717fa15165d3d9245614680bebc48a52ac05d, 9372fa1d73da5f1673921e365d0cd2c27ec7adc2, 28b21c558a3753171097193b6f6602a94169093a |
| Linux | Linux Kernel | before 5.10.226; 5.11 up to, but not including, 5.15.22; 5.16 up to, but not including, 5.16.8; 5.17 | 5.10.226, 5.15.22, 5.16.8 |
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: btrfs: fix use-after-free after failure to create a snapshot At ioctl.c:create_snapshot(), we allocate a pending snapshot structure and then attach it to the transaction's list of pending snapshots. After that we call btrfs_commit_transaction(), and if that returns an error we jump to 'fail' label, where we kfree() the pending snapshot structure. This can result in a later use-after-free of the pending snapshot: 1) We allocated the pending snapshot and added it to the transaction's list of pending snapshots; 2) We call btrfs_commit_transaction(), and it fails either at the first call to btrfs_run_delayed_refs() or btrfs_start_dirty_block_groups(). In both cases, we don't abort the transaction and we release our transaction handle. We jump to the 'fail' label and free the pending snapshot structure. We return with the pending snapshot still in the transaction's list; 3) Another task commits the transaction. This time there's no error at all, and then during the transaction commit it accesses a pointer to the pending snapshot structure that the snapshot creation task has already freed, resulting in a user-after-free. This issue could actually be detected by smatch, which produced the following warning: fs/btrfs/ioctl.c:843 create_snapshot() warn: '&pending_snapshot->list' not removed from list So fix this by not having the snapshot creation ioctl directly add the pending snapshot to the transaction's list. Instead add the pending snapshot to the transaction handle, and then at btrfs_commit_transaction() we add the snapshot to the list only when we can guarantee that any error returned after that point will result in a transaction abort, in which case the ioctl code can safely free the pending snapshot and no one can access it anymore.
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
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
- 8.8 High severity
Spotted an error? Tell us.