Bug 2307858 (CVE-2024-43885)

Summary: CVE-2024-43885 kernel: btrfs: fix double inode unlock for direct IO sync writes
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dfreiber, drow, jburrell, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw in the Linux kernel’s btrfs filesystem was identified during direct I/O synchronous writes where the inode could be incorrectly unlocked twice. This issue arose in the btrfs_sync_file() function when certain conditions, such as skipping inode logging or encountering errors while starting a transaction or flushing delayed allocations, led to premature inode unlocking at the out_release_extents label.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2308103    
Bug Blocks:    

Description OSIDB Bzimport 2024-08-26 11:20:31 UTC
In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix double inode unlock for direct IO sync writes

If we do a direct IO sync write, at btrfs_sync_file(), and we need to skip
inode logging or we get an error starting a transaction or an error when
flushing delalloc, we end up unlocking the inode when we shouldn't under
the 'out_release_extents' label, and then unlock it again at
btrfs_direct_write().

Fix that by checking if we have to skip inode unlocking under that label.

Comment 1 Mauro Matteo Cascella 2024-08-27 10:32:17 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024082652-CVE-2024-43885-3500@gregkh/T

Comment 2 Mauro Matteo Cascella 2024-08-27 10:34:17 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024082652-CVE-2024-43885-3500@gregkh/T