VYPR
Unrated severityNVD Advisory· Published Dec 24, 2025· Updated Apr 15, 2026

CVE-2022-50766

CVE-2022-50766

Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer

syzbot is reporting uninit-value in btrfs_clean_tree_block() [1], for commit bc877d285ca3dba2 ("btrfs: Deduplicate extent_buffer init code") missed that btrfs_set_header_generation() in btrfs_init_new_buffer() must not be moved to after clean_tree_block() because clean_tree_block() is calling btrfs_header_generation() since commit 55c69072d6bd5be1 ("Btrfs: Fix extent_buffer usage when nodesize != leafsize").

Since memzero_extent_buffer() will reset "struct btrfs_header" part, we can't move btrfs_set_header_generation() to before memzero_extent_buffer(). Just re-add btrfs_set_header_generation() before btrfs_clean_tree_block().

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

In the Linux kernel btrfs, generation is set after clean_tree_block, causing uninit-value; fix reorders to set generation before clean.

The vulnerability is an initialization ordering bug in the btrfs filesystem driver within the Linux kernel. In btrfs_init_new_buffer, the function btrfs_set_header_generation() was inadvertently moved to after btrfs_clean_tree_block() during a refactoring commit (bc877d285ca3dba2). However, btrfs_clean_tree_block() reads the header generation via btrfs_header_generation(), expecting it to be set before the cleanup call. This results in an uninitialized value being used [1].

The attack surface is local; an attacker would need the ability to trigger btrfs buffer initialization operations, which typically requires user privileges to mount and interact with btrfs filesystems. The bug is triggered during normal file system operations, making it exploitable without special conditions [2].

The impact includes reading uninitialized kernel memory, which could lead to information disclosure (leaking sensitive kernel data) or a kernel crash (denial of service). The kernel's syzbot fuzzer reported this as an "uninit-value" bug, indicating potential for instability or data exposure.

Mitigation is available through stable kernel updates. The fix (re-adding btrfs_set_header_generation() before btrfs_clean_tree_block()) has been applied in the Linux kernel stable branches. Users should update their kernels to include the patched versions referenced in commits [1] and [2].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1

Patches

4

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.