CVE-2022-50766
btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer
Check your servers for CVE-2022-50766
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-50766 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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().
Exploitation
EPSS 0.26%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 18.2% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from bc877d285ca3dba24c52406946a4a69847cc7422, before 0a408c6212c16b9a2a1141d3c531247582ef8101 affected from bc877d285ca3dba24c52406946a4a69847cc7422, before a687c2890fe4a2acaac6941fa4097a1264d8f3eb affected from bc877d285ca3dba24c52406946a4a69847cc7422, before 89bc41c92d10b905c60f6ec13c9ef664a3555c54 affected from bc877d285ca3dba24c52406946a4a69847cc7422, before cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38
Other versions: unaffected
|
| Linux |
affected 4.19 unaffected before 4.19 unaffected from 5.15.75 up to and including 5.15.* unaffected from 5.19.17 up to and including 5.19.* unaffected from 6.0.3 up to and including 6.0.* unaffected 6.1 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-50766 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-50766
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-50766
trivy image --scanners vuln IMAGE | grep CVE-2022-50766
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/0a408c6212c16b9a2a1141d3c531247582ef8101 git.kernel.org
- https://git.kernel.org/stable/c/a687c2890fe4a2acaac6941fa4097a1264d8f3eb git.kernel.org
- https://git.kernel.org/stable/c/89bc41c92d10b905c60f6ec13c9ef664a3555c54 git.kernel.org
- https://git.kernel.org/stable/c/cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38 git.kernel.org
Source: the record CVE-2022-50766 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse