Skip to content
Medium 4.7

f2fs: fix to use bio_in_atomic() in f2fs_read_end_io()

CVE-2026-100092 First seen on SecPulse

Affected packages

PackageAffected → Fixed
LinuxLinux —
LinuxKernel
≥ 6.1.148, < 6.1.193→ 6.1.193
≥ 6.6.102, < 6.6.163→ 6.6.163
≥ 6.12.42, < 6.12.118→ 6.12.118
≥ 6.15.10, < 6.16→ 6.16
≥ 6.16.1, < 6.17→ 6.17
≥ 6.17.0, < 6.18.64→ 6.18.64
≥ 6.19.0, < 7.3.4→ 7.3.4

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

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…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details