f2fs: fix to use bio_in_atomic() in f2fs_read_end_io()
- CVE-2026-100092
- GHSA-8g7v-rhv6-xjc9
- EUVD-2026-138507
Description
Show the whole descriptionHide the whole description
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to use bio_in_atomic() in f2fs_read_end_io() f2fs_read_end_io() uses "in_task() && !irqs_disabled()" to decide whether it is safe to sleep, the result is passed down as @in_task to: - f2fs_put_dic() -> f2fs_free_dic() -> f2fs_release_decomp_mem() -> vm_unmap_ram(), which may sleep. - f2fs_end_read_compressed_page() -> f2fs_cache_compressed_page() -> f2fs_grab_cache() -> f2fs_lock_cache(), which may sleep in wait_on_bit_lock(). However, the check still treats below task contexts as sleepable: - with spinlock held via spin_lock(), i.e. preempt count != 0 while irqs are enabled. - with BH disabled via local_bh_disable(). - inside an RCU read lock on kernels with CONFIG_PREEMPTION. - with any spinlock held on kernels without CONFIG_PREEMPT_COUNT. So the "sleeping function called from invalid context" issue fixed by commit 08a7efc5b02a ("f2fs: vm_unmap_ram() may be called from an invalid context") can still be triggered. The block layer provides bio_in_atomic() for exactly this purpose, it checks rcu_preempt_depth() and preemptible(), and conservatively returns true if CONFIG_PREEMPT_COUNT is disabled, let's use it instead. The difference is as below: old: intask = in_task() && !irqs_disabled() new: intask = !bio_in_atomic() Context | old intask | new intask -------------------------------------+----------------+---------------- Hard IRQ / softirq | false | false IRQs disabled | false | false spin_lock() held, IRQs enabled | true (wrong) | false BH disabled by local_bh_disable() | true (wrong) | false RCU read lock (CONFIG_PREEMPTION) | true (wrong) | false Spinlock held, w/o PREEMPT_COUNT | true (wrong) | false Note that on kernels without CONFIG_PREEMPT_COUNT, bio_in_atomic() always returns true, so dic freeing will always be offloaded to sbi->wq, and compressed pages will not be cached in f2fs_read_end_io(); this is the price of correctness, since there is no way to tell whether the current context can sleep.
Text from the CVE.org record.
Recommendation
Linux
- If you run a version from 6.15.10 to before 6.16update to 6.16 or laterMinor version change: check the release notes
- If you run 6.12.xupdate to 6.12.118 or laterPatch update: breaking changes are unlikely
- If you run 6.6.xupdate to 6.6.163 or laterPatch update: breaking changes are unlikely
- If you run 6.1.xupdate to 6.1.193 or laterPatch update: breaking changes are unlikely
Some affected versions have no stated fix.
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
Linux
Affected versions Fixed in from 6.15.10 to before 6.16 6.16 from 6.12.42 to before 6.12.118 6.12.118 from 6.6.102 to before 6.6.163 6.6.163 from 6.1.148 to before 6.1.193 6.1.193 from 6.16.1 to before 6.17 none stated 6.17 none stated before 6.17: not affected none stated from 6.1.193 up to 6.1.*: not affected none stated and 5 more
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.