PT-2022-7659 · Linux+5 · Linux Kernel+5

Filipe Manana

·

Published

2022-01-31

·

Updated

2025-05-27

·

CVE-2022-48733

CVSS v3.1

7.8

High

VectorAV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Linux kernel (affected versions not specified)
Description The issue is related to a use-after-free vulnerability in the Linux kernel's btrfs file system. Specifically, it occurs when creating a snapshot and the btrfs commit transaction() function fails, leading to a situation where a pending snapshot structure is freed but still accessible, resulting in a user-after-free scenario. This can happen in the following sequence:
  1. A pending snapshot is allocated and added to the transaction's list of pending snapshots.
  2. btrfs commit transaction() is called, and if it fails, the pending snapshot structure is freed.
  3. Another task commits the transaction without errors, accessing the already freed pending snapshot structure, thus causing a user-after-free.
The vulnerability could be detected by smatch, which produced a warning about the pending snapshot not being removed from the list. To fix this, the snapshot creation ioctl should not directly add the pending snapshot to the transaction's list. Instead, it should add the pending snapshot to the transaction handle, and then at btrfs commit transaction(), add the snapshot to the list only when it can be guaranteed that any error returned after that point will result in a transaction abort.
Recommendations At the moment, there is no information about a newer version that contains a fix for this vulnerability.

Exploit

Use After Free

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

BDU:2024-08341
CVE-2022-48733
DLA-3912-1
OESA-2024-1838
OESA-2024-1839
OPENSUSE-SU-2024_2372-1
OPENSUSE-SU-2024_2394-1
SUSE-SU-2024:2360-1
SUSE-SU-2024:2372-1
SUSE-SU-2024:2381-1
SUSE-SU-2024:2394-1
SUSE-SU-2024:2561-1
SUSE-SU-2024:2939-1
USN-7121-1
USN-7121-2
USN-7121-3
USN-7148-1
USN-7159-1
USN-7159-2
USN-7159-3
USN-7159-4
USN-7159-5
USN-7195-1
USN-7195-2

Affected Products

Astra Linux
Linuxmint
Linux Kernel
Red Os
Suse
Ubuntu