# CVE-2022-50766: btrfs: set generation before calling btrfs\_clean\_tree\_block in btrfs\_init\_new\_buffer

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **Published:** 2025-12-24T13:05:56.873Z
- **Modified:** 2026-11-10T12:10:00.177Z

## Who should check

- Anyone running Linux \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< 0a408c6212c16b9a2a1141d3c531247582ef8101; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< a687c2890fe4a2acaac6941fa4097a1264d8f3eb; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< 89bc41c92d10b905c60f6ec13c9ef664a3555c54; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38
- Anyone running Linux 4.19

## 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().

## Affected and fixed versions

- Linux: \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< 0a408c6212c16b9a2a1141d3c531247582ef8101; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< a687c2890fe4a2acaac6941fa4097a1264d8f3eb; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< 89bc41c92d10b905c60f6ec13c9ef664a3555c54; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38 (cvelist)
- Linux: 4.19 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50766. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50766.md
Affected: Linux >= bc877d285ca3dba24c52406946a4a69847cc7422, < 0a408c6212c16b9a2a1141d3c531247582ef8101; >= bc877d285ca3dba24c52406946a4a69847cc7422, < a687c2890fe4a2acaac6941fa4097a1264d8f3eb; >= bc877d285ca3dba24c52406946a4a69847cc7422, < 89bc41c92d10b905c60f6ec13c9ef664a3555c54; >= bc877d285ca3dba24c52406…
Fixed in: Linux 0a408c6212c16b9a2a1141d3c531247582ef8101, Linux 89bc41c92d10b905c60f6ec13c9ef664a3555c54

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50766 being exploited?

There is no confirmed exploitation: CVE-2022-50766 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50766?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2022-50766?

Linux \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< 0a408c6212c16b9a2a1141d3c531247582ef8101; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< a687c2890fe4a2acaac6941fa4097a1264d8f3eb; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< 89bc41c92d10b905c60f6ec13c9ef664a3555c54; \>= bc877d285ca3dba24c52406946a4a69847cc7422, \< cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38; Linux 4.19.

### Is there a fix for CVE-2022-50766?

Yes. Fixed in Linux 0a408c6212c16b9a2a1141d3c531247582ef8101, Linux 89bc41c92d10b905c60f6ec13c9ef664a3555c54. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-50766?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/0a408c6212c16b9a2a1141d3c531247582ef8101>
- other: <https://git.kernel.org/stable/c/a687c2890fe4a2acaac6941fa4097a1264d8f3eb>
- other: <https://git.kernel.org/stable/c/89bc41c92d10b905c60f6ec13c9ef664a3555c54>
- other: <https://git.kernel.org/stable/c/cbddcc4fa3443fe8cfb2ff8e210deb1f6a0eea38>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50766>

HTML: <https://flawdb.com/CVE-2022-50766> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50766>
