CVE-2026-100092: f2fs: fix to use bio_in_atomic() in f2fs_read_end_io()

Published Nov 30, 2026
·
Updated

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

f2fs: fix to use bioinatomic() in f2fsreadendio()

f2fsreadendio() uses "intask() && !irqsdisabled()" to decide whether it is safe to sleep, the result is passed down as @intask to: - f2fsputdic() -> f2fsfreedic() -> f2fsreleasedecompmem() -> vmunmapram(), which may sleep. - f2fsendreadcompressedpage() -> f2fscachecompressedpage() -> f2fsgrabcache() -> f2fslockcache(), which may sleep in waitonbitlock().

However, the check still treats below task contexts as sleepable: - with spinlock held via spinlock(), i.e. preempt count != 0 while irqs are enabled. - with BH disabled via localbhdisable(). - inside an RCU read lock on kernels with CONFIGPREEMPTION. - with any spinlock held on kernels without CONFIGPREEMPTCOUNT.

So the "sleeping function called from invalid context" issue fixed by commit 08a7efc5b02a ("f2fs: vmunmapram() may be called from an invalid context") can still be triggered.

The block layer provides bioinatomic() for exactly this purpose, it checks rcupreemptdepth() and preemptible(), and conservatively returns true if CONFIGPREEMPTCOUNT is disabled, let's use it instead. The difference is as below:

old: intask = intask() && !irqsdisabled() new: intask = !bioinatomic()

Context | old intask | new intask -------------------------------------+----------------+---------------- Hard IRQ / softirq | false | false IRQs disabled | false | false spinlock() held, IRQs enabled | true (wrong) | false BH disabled by localbhdisable() | true (wrong) | false RCU read lock (CONFIGPREEMPTION) | true (wrong) | false Spinlock held, w/o PREEMPTCOUNT | true (wrong) | false

Note that on kernels without CONFIGPREEMPTCOUNT, bioinatomic() always returns true, so dic freeing will always be offloaded to sbi->wq, and compressed pages will not be cached in f2fsreadendio(); this is the price of correctness, since there is no way to tell whether the current context can sleep.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In f2fs_read_end_io(), use bio_in_atomic() instead of in_task() && !irqs_disabled() to determine whether the current context can sleep.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:23 PM
Data Sourced
via MITRE·01:23 PM
Description

Frequently Asked Questions

1

Which execution contexts can trigger the invalid-sleep condition?

The affected read completion path can incorrectly treat execution as sleepable while a spinlock is held, bottom halves are disabled, or an RCU read lock is held on kernels with CONFIG_PREEMPTION. These contexts can reach operations that may sleep, including vm_unmap_ram() and wait_on_bit_lock().

2

Are kernels without CONFIG_PREEMPT_COUNT relevant?

Yes. On kernels without CONFIG_PREEMPT_COUNT, the existing check can also misclassify contexts with any spinlock held as sleepable. The replacement bio_in_atomic() check conservatively treats such configurations as atomic.

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