fuse: fix invalidate lock leak on open O_TRUNC DAX failure
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 5.15.220, 5.11, 5.19, 5.20, 6.1.187, and 5 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
In the Linux kernel, the following vulnerability has been resolved: fuse: fix invalidate lock leak on open O_TRUNC DAX failure fuse_open() takes filemap_invalidate_lock() for a DAX truncate (dax_truncate = true) and releases it before the out_inode_unlock label. But when fuse_dax_break_layouts() fails, the goto out_inode_unlock skips the unlock and leaks the rwsem, so any later fault or truncate on the file stalls on the stale lock. fuse_dax_break_layouts() can fail with -ERESTARTSYS when a signal interrupts the wait for busy DAX pages to drain: open("file", O_RDWR | O_TRUNC) └─ fuse_open() ├─ filemap_invalidate_lock() # dax_truncate └─ fuse_dax_break_layouts() └─ dax_break_layout() └─ wait_page_idle() # TASK_INTERRUPTIBLE └─ fuse_wait_dax_page() # unlock, schedule, re-lock └─ signal → -ERESTARTSYS goto out_inode_unlock # <- lock leaked Fix this by moving filemap_invalidate_unlock() below the label so that all error paths release the lock, and rename the label to out_unlock as it now covers more than just the inode lock.
Timeline
- CVE published
- Record last updated
Affected versions
- Linux Linux
From d58366aab86854217b81679d1a9dcd54a2edfc2a · fixed in 1b04d80a27d317064cce2307472f5bef9975bc50; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in a61524da59a2f5ac9c8de23ff98b30da769ab144; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in dcf30a56624c2a0cfab1bada5b1ca8cc0c02f010; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in 7288c279ddbd654a06c82118c1a3f5570c1807f0; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in 776e85fda752f9a15e0f82dec42ecacd12a9bd94; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in 1d3e701cda2f41d48aa721b3ebefbe0fbf8d74da; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in e981474d7bf1457da12404e169ea147d2c8ecea7; From 2fdbb8dd01556e1501132b5ad3826e8f71e24a8b · fixed in a927f1867e61b78f39f9da0bbba3c98c2ca151fe; From 5.15.109 · fixed in 5.15.220; From 5.10.179 · fixed in 5.11; From 5.18.18 · fixed in 5.19; From 5.19.2 · fixed in 5.20
- Linux Linux
6.0
- KernelLinux
fixed in 5.15.220; From 5.16.0 · fixed in 6.1.187; From 6.0.0 · fixed in 6.6.156; From 6.2.0 · fixed in 6.12.108; From 6.7.0 · fixed in 6.18.49; From 6.13.0 · fixed in 7.1.13; From 6.19.0 · fixed in 7.2.3
References 8
git.kernel.org
- stable/c/1b04d80a27d317064cce2307472f5bef9975bc50
- stable/c/a61524da59a2f5ac9c8de23ff98b30da769ab144
- stable/c/dcf30a56624c2a0cfab1bada5b1ca8cc0c02f010
- stable/c/7288c279ddbd654a06c82118c1a3f5570c1807f0
- stable/c/776e85fda752f9a15e0f82dec42ecacd12a9bd94
- stable/c/1d3e701cda2f41d48aa721b3ebefbe0fbf8d74da
- stable/c/e981474d7bf1457da12404e169ea147d2c8ecea7
- stable/c/a927f1867e61b78f39f9da0bbba3c98c2ca151fe