io_uring/rw: end write accounting from ->ki_complete
- 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.11, 5.16, 6.1, 6.6.160, 6.12.112, and 2 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: io_uring/rw: end write accounting from ->ki_complete Commit b000145e9907 moved both the fsnotify calls and the write accounting out of the kiocb completion handler and into the io_req_rw_complete() task_work. However, only the fsnotify part actually needed to move as it may sleep. Ending the write accounting is just a percpu_up_read() on the superblock writers sem. Deferring it is a problem, because it makes dropping SB_FREEZE_WRITE protection depend on the ring owner getting to running task_work. But the task may be blocked in freeze_super(), causing it to never get to that: task io-wq worker -------------------------------------------------------------- io_write() io_kiocb_start_write() (takes sb_writers, hidden from lockdep by __sb_writers_release) write_iter() -> -EIOCBQUEUED ioctl(FS_IOC_SHUTDOWN) bdev_freeze() freeze_super() percpu_down_write() <- waits for the reader above io_write() kiocb_start_write() percpu_down_read() <- queued behind the writer <bio completes> io_complete_rw() queues io_req_rw_complete() <- never runs, task is in D state End the write from io_complete_rw() instead, and leave only the fsnotify calls in task_work.
Timeline
- CVE published
- Record last updated
Affected versions
- Linux Linux
From b000145e9907809406d8164c3b2b8861d95aecd1 · fixed in ed1cead97afb9c398bd7ab344a3c1ee34ab73af9; From b000145e9907809406d8164c3b2b8861d95aecd1 · fixed in 696459029f3b65c070c91b729478475582f1dcdf; From b000145e9907809406d8164c3b2b8861d95aecd1 · fixed in cc580cee4dfa2ec9099c30ecbd4d804cbb996432; From b000145e9907809406d8164c3b2b8861d95aecd1 · fixed in 055d43a1233edbd80e558889258105ce63051bcd; From b000145e9907809406d8164c3b2b8861d95aecd1 · fixed in 796aa0547557e63338657ed1c487906f9fac4c73; From 5.10.165 · fixed in 5.11; From 5.15.90 · fixed in 5.16; From 6.0.3 · fixed in 6.1
- Linux Linux
6.1
- KernelLinux
From 6.1.0 · fixed in 6.6.160; From 6.7.0 · fixed in 6.12.112; From 6.13.0 · fixed in 6.18.53; From 6.19.0 · fixed in 7.2.7