CVE-2022-48833: btrfs: skip reserved bytes warning on unmount after log cleanup failure

Published Jul 16, 2024
·
Updated

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

btrfs: skip reserved bytes warning on unmount after log cleanup failure

After the recent changes made by commit c2e39305299f01 ("btrfs: clear extent buffer uptodate when we fail to write it") and its followup fix, commit 651740a5024117 ("btrfs: check WRITEERR when trying to read an extent buffer"), we can now end up not cleaning up space reservations of log tree extent buffers after a transaction abort happens, as well as not cleaning up still dirty extent buffers.

This happens because if writeback for a log tree extent buffer failed, then we have cleared the bit EXTENTBUFFERUPTODATE from the extent buffer and we have also set the bit EXTENTBUFFERWRITEERR on it. Later on, when trying to free the log tree with freelogtree(), which iterates over the tree, we can end up getting an -EIO error when trying to read a node or a leaf, since readextentbufferpages() returns -EIO if an extent buffer does not have EXTENTBUFFERUPTODATE set and has the EXTENTBUFFERWRITEERR bit set. Getting that -EIO means that we return immediately as we can not iterate over the entire tree.

In that case we never update the reserved space for an extent buffer in the respective block group and spaceinfo object.

When this happens we get the following traces when unmounting the fs:

[174957.284509] BTRFS: error (device dm-0) in cleanuptransaction:1913: errno=-5 IO failure [174957.286497] BTRFS: error (device dm-0) in freelogtree:3420: errno=-5 IO failure [174957.399379] ------------[ cut here ]------------ [174957.402497] WARNING: CPU: 2 PID: 3206883 at fs/btrfs/block-group.c:127 btrfsputblockgroup+0x77/0xb0 [btrfs] [174957.407523] Modules linked in: btrfs overlay dmzero (...) [174957.424917] CPU: 2 PID: 3206883 Comm: umount Tainted: G W 5.16.0-rc5-btrfs-next-109 #1 [174957.426689] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [174957.428716] RIP: 0010:btrfsputblockgroup+0x77/0xb0 [btrfs] [174957.429717] Code: 21 48 8b bd (...) [174957.432867] RSP: 0018:ffffb70d41cffdd0 EFLAGS: 00010206 [174957.433632] RAX: 0000000000000001 RBX: ffff8b09c3848000 RCX: ffff8b0758edd1c8 [174957.434689] RDX: 0000000000000001 RSI: ffffffffc0b467e7 RDI: ffff8b0758edd000 [174957.436068] RBP: ffff8b0758edd000 R08: 0000000000000000 R09: 0000000000000000 [174957.437114] R10: 0000000000000246 R11: 0000000000000000 R12: ffff8b09c3848148 [174957.438140] R13: ffff8b09c3848198 R14: ffff8b0758edd188 R15: dead000000000100 [174957.439317] FS: 00007f328fb82800(0000) GS:ffff8b0a2d200000(0000) knlGS:0000000000000000 [174957.440402] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [174957.441164] CR2: 00007fff13563e98 CR3: 0000000404f4e005 CR4: 0000000000370ee0 [174957.442117] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [174957.443076] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [174957.443948] Call Trace: [174957.444264] <TASK> [174957.444538] btrfsfreeblockgroups+0x255/0x3c0 [btrfs] [174957.445238] closectree+0x301/0x357 [btrfs] [174957.445803] ? callrcu+0x16c/0x290 [174957.446250] genericshutdownsuper+0x74/0x120 [174957.446832] killanonsuper+0x14/0x30 [174957.447305] btrfskillsuper+0x12/0x20 [btrfs] [174957.447890] deactivatelockedsuper+0x31/0xa0 [174957.448440] cleanupmnt+0x147/0x1c0 [174957.448888] taskworkrun+0x5c/0xa0 [174957.449336] exittousermodeprepare+0x1e5/0x1f0 [174957.449934] syscallexittousermode+0x16/0x40 [174957.450512] dosyscall64+0x48/0xc0 [174957.450980] entrySYSCALL64afterhwframe+0x44/0xae [174957.451605] RIP: 0033:0x7f328fdc4a97 [174957.452059] Code: 03 0c 00 f7 (...) [174957.454320] RSP: 002b:00007fff13564ec8 EFLAGS: 00000246 ORIGRAX: 00000000000000a6 [174957.455262] RAX: 0000000000000000 RBX: 00007f328feea264 RCX: 00007f328fdc4a97 [174957.456131] RDX: 0000000000000000 RSI: 00000000000000 ---truncated---

Affected Software

14 affected components
Linux Linux kernel
Linux Linux kernel>=5.4.165<5.5
Linux Linux kernel>=5.10.85<5.11
Linux Linux kernel>=5.15.8<5.15.31
Linux Linux kernel>=5.15.11<5.16
Linux Linux kernel>=5.16.1<5.16.17
Linux Linux kernel>=5.18<5.17
Linux Linux kernel=5.16
Linux Linux kernel=5.16-rc6
Linux Linux kernel=5.16-rc7
Linux Linux kernel=5.16-rc8
Linux Linux kernel=5.17-rc1
Linux Linux kernel=5.17-rc2
Microsoft cbl2 kernel 5.15.186.1-1

Event History

Jul 16, 2024
CVE Published
via MITRE·12:25 PM
Data Sourced
via MITRE·12:25 PM
Description
Data Sourced
via NVD·01:15 PM
RemedyDescriptionSeverityAffected Software
Feb 18, 2026
Data Sourced
via Microsoft·10:49 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-48833?

CVE-2022-48833 is classified as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2022-48833?

To remediate CVE-2022-48833, update to the latest version of the Linux kernel where the vulnerability has been patched.

3

What components are affected by CVE-2022-48833?

CVE-2022-48833 affects the Linux kernel and specifically impacts the Btrfs file system.

4

What are the potential impacts of CVE-2022-48833?

The potential impacts of CVE-2022-48833 include system instability and possible data integrity issues during unmount operations.

5

Is CVE-2022-48833 exploitable remotely?

CVE-2022-48833 is not considered to be remotely exploitable as it requires local system access to trigger its effects.

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