CVE-2024-44972: btrfs: do not clear page dirty inside extent_write_locked_range()

Published Sep 4, 2024
·
Updated

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

btrfs: do not clear page dirty inside extentwritelockedrange()

[BUG] For subpage + zoned case, the following workload can lead to rsv data leak at unmount time:

# mkfs.btrfs -f -s 4k $dev # mount $dev $mnt # fsstress -w -n 8 -d $mnt -s 1709539240 0/0: fiemap - no filename 0/1: copyrange read - no filename 0/2: write - no filename 0/3: rename - no source filename 0/4: creat f0 x:0 0 0 0/4: creat add id=0,parent=-1 0/5: writev f0[259 1 0 0 0 0] [778052,113,965] 0 0/6: ioctl(FIEMAP) f0[259 1 0 0 224 887097] [1294220,2291618343991484791,0x10000] -1 0/7: dwrite - xfsctl(XFSIOCDIOINFO) f0[259 1 0 0 224 887097] return 25, fallback to stat() 0/7: dwrite f0[259 1 0 0 224 887097] [696320,102400] 0 # umount $mnt

The dmesg includes the following rsv leak detection warning (all call trace skipped):

------------[ cut here ]------------ WARNING: CPU: 2 PID: 4528 at fs/btrfs/inode.c:8653 btrfsdestroyinode+0x1e0/0x200 [btrfs] ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ WARNING: CPU: 2 PID: 4528 at fs/btrfs/inode.c:8654 btrfsdestroyinode+0x1a8/0x200 [btrfs] ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ WARNING: CPU: 2 PID: 4528 at fs/btrfs/inode.c:8660 btrfsdestroyinode+0x1a0/0x200 [btrfs] ---[ end trace 0000000000000000 ]--- BTRFS info (device sda): last unmount of filesystem 1b4abba9-de34-4f07-9e7f-157cf12a18d6 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 4528 at fs/btrfs/block-group.c:4434 btrfsfreeblockgroups+0x338/0x500 [btrfs] ---[ end trace 0000000000000000 ]--- BTRFS info (device sda): spaceinfo DATA has 268218368 free, is not full BTRFS info (device sda): spaceinfo total=268435456, used=204800, pinned=0, reserved=0, mayuse=12288, readonly=0 zoneunusable=0 BTRFS info (device sda): globalblockrsv: size 0 reserved 0 BTRFS info (device sda): transblockrsv: size 0 reserved 0 BTRFS info (device sda): chunkblockrsv: size 0 reserved 0 BTRFS info (device sda): delayedblockrsv: size 0 reserved 0 BTRFS info (device sda): delayedrefsrsv: size 0 reserved 0 ------------[ cut here ]------------ WARNING: CPU: 3 PID: 4528 at fs/btrfs/block-group.c:4434 btrfsfreeblockgroups+0x338/0x500 [btrfs] ---[ end trace 0000000000000000 ]--- BTRFS info (device sda): spaceinfo METADATA has 267796480 free, is not full BTRFS info (device sda): spaceinfo total=268435456, used=131072, pinned=0, reserved=0, mayuse=262144, readonly=0 zoneunusable=245760 BTRFS info (device sda): globalblockrsv: size 0 reserved 0 BTRFS info (device sda): transblockrsv: size 0 reserved 0 BTRFS info (device sda): chunkblockrsv: size 0 reserved 0 BTRFS info (device sda): delayedblockrsv: size 0 reserved 0 BTRFS info (device sda): delayedrefsrsv: size 0 reserved 0

Above $dev is a tcmu-runner emulated zoned HDD, which has a max zone append size of 64K, and the system has 64K page size.

[CAUSE] I have added several traceprintk() to show the events (header skipped):

> btrfsdirtypages: r/i=5/259 dirty start=774144 len=114688 > btrfsdirtypages: r/i=5/259 dirty part of page=720896 offinpage=53248 leninpage=12288 > btrfsdirtypages: r/i=5/259 dirty part of page=786432 offinpage=0 leninpage=65536 > btrfsdirtypages: r/i=5/259 dirty part of page=851968 offinpage=0 leninpage=36864

The above lines show our buffered write has dirtied 3 pages of inode 259 of root 5:

704K 768K 832K 896K I |////I/////////////////I///////////| I 756K 868K

|///| is the dirtied range using subpage bitmaps. and 'I' is the page boundary.

Meanwhile all three pages (704K, 768K, 832K) have their PageDirty flag set.

> btrfsdirectwrite: r/i=5/259 start dio filepos=696320 len=102400

Then direct IO writ ---truncated---

Other sources

Rejected reason: This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.

NVD

Affected Software

3 affected componentsFixes available
Linux Linux kernel<6.6.46
Linux Linux kernel>=6.7<6.10.5
debian/linux<=5.10.223-1, <=5.10.234-1, <=6.1.129-1, <=6.1.135-1
6.12.25-16.12.27-1

Event History

Sep 4, 2024
CVE Published
via MITRE·06:56 PM
Rejected
via MITRE·06:56 PM
Data Sourced
via NVD·07:15 PM
Description
Apr 27, 2025
Data Sourced
via Ubuntu·07:38 PM
RemedyDescriptionSeverityAffected Software
Jan 5, 2026
Rejected
via MITRE·11:10 AM

Frequently Asked Questions

1

What is the severity of CVE-2024-44972?

CVE-2024-44972 is considered a medium severity vulnerability affecting the Linux kernel.

2

How do I fix CVE-2024-44972?

To fix CVE-2024-44972, you should upgrade to the appropriate versions of the Linux kernel, specifically 6.12.12-1 or 6.12.16-1.

3

What systems are affected by CVE-2024-44972?

CVE-2024-44972 affects various versions of the Linux kernel, specifically those below 6.6.46 and specific Debian packages.

4

What is the cause of CVE-2024-44972?

CVE-2024-44972 is caused by a bug in the btrfs implementation that leads to a data leak during unmounting.

5

Can CVE-2024-44972 lead to data loss?

While CVE-2024-44972 primarily leads to data leakage, it could potentially expose sensitive information if not mitigated.

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