CVE-2026-74321: btrfs: fix invalid pointer dereference in __btrfs_run_delayed_refs()

Published Aug 15, 2026
·
Updated

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

btrfs: fix invalid pointer dereference in btrfsrundelayedrefs()

In the beginning of the loop, we try to obtain a locked delayed ref head, if 'lockedref' is currently NULL, by calling btrfsselectrefhead(), which can return an error pointer. If the error pointer is -EAGAIN we do a continue and go back to the beginning of the loop, which will not try again to call btrfsselectrefhead() since 'lockedref' is no longer NULL but it's ERRPTR(-EAGAIN), and then we do:

spinlock(&lockedref->lock);

against a ERRPTR(-EAGAIN) value, generating an invalid pointer dereference.

Fix this by ensuring that 'lockedref' is set to NULL when btrfsselectrefhead() returns ERRPTR(-EAGAIN) and incrementing 'count' as well, to prevent infinite looping. We do this by doing a goto to the bottom of the loop that already sets 'lockedref' to NULL and does a condresched(), with an increment to 'count' right before the goto. These measures were in place before the refactoring in commit 0110a4c43451 ("btrfs: refactor btrfsrundelayedrefs loop") but were unintentionally lost afterwards.

Event History

Aug 15, 2026
CVE Published
via MITRE·05:58 AM
Data Sourced
via MITRE·05:58 AM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203