CVE-2022-50067
BaseFortify
Publication date: 2025-06-18
Last updated on: 2025-11-17
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | 6.0 |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-416 | 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. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a use-after-free bug in the Linux kernel's btrfs filesystem code. Specifically, when relocating block groups, if a transaction commit fails during the relocation process, the system frees a control structure but does not clear its reference. Later, the system attempts to use this freed memory, leading to a use-after-free condition. This can be triggered by calling btrfs_ioctl_balance() before btrfs_ioctl_defrag(). The fix involves checking for transaction commit failure and unsetting the control reference to prevent use-after-free.
How can this vulnerability impact me? :
This vulnerability can cause a use-after-free condition in the btrfs filesystem, which may lead to system instability, crashes, or potential kernel memory corruption. Exploiting this bug could allow an attacker to cause denial of service or possibly execute arbitrary code with kernel privileges, impacting system security and reliability.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by monitoring the system logs for use-after-free errors related to btrfs, specifically messages from KASAN (Kernel Address Sanitizer) indicating a use-after-free in btrfs_init_reloc_root. You can check the kernel logs using commands like 'dmesg | grep -i btrfs' or 'journalctl -k | grep -i btrfs' to look for such error messages.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include avoiding the sequence of btrfs ioctl calls that can trigger the bug, specifically not calling btrfs_ioctl_balance() before btrfs_ioctl_defrag(). Additionally, updating the Linux kernel to a version where this vulnerability is fixed is recommended.