Advisory Published
Updated

CVE-2025-21853: bpf: avoid holding freeze_mutex during mmap operation

First published: Wed Mar 12 2025(Updated: )

In the Linux kernel, the following vulnerability has been resolved: bpf: avoid holding freeze_mutex during mmap operation We use map->freeze_mutex to prevent races between map_freeze() and memory mapping BPF map contents with writable permissions. The way we naively do this means we'll hold freeze_mutex for entire duration of all the mm and VMA manipulations, which is completely unnecessary. This can potentially also lead to deadlocks, as reported by syzbot in [0]. So, instead, hold freeze_mutex only during writeability checks, bump (proactively) "write active" count for the map, unlock the mutex and proceed with mmap logic. And only if something went wrong during mmap logic, then undo that "write active" counter increment. [0] https://lore.kernel.org/bpf/678dcbc9.050a0220.303755.0066.GAE@google.com/

Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Affected SoftwareAffected VersionHow to fix
Linux Kernel
Linux Kernel>=5.5<6.6.80
Linux Kernel>=6.7<6.12.17
Linux Kernel>=6.13<6.13.5
Linux Kernel=6.14-rc1
Linux Kernel=6.14-rc2
Linux Kernel=6.14-rc3

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of CVE-2025-21853?

    CVE-2025-21853 has been classified as having a moderate severity level.

  • How do I fix CVE-2025-21853?

    To fix CVE-2025-21853, update your Linux kernel to the latest version that addresses this vulnerability.

  • What are the potential impacts of CVE-2025-21853?

    CVE-2025-21853 may allow for race conditions during memory mapping of BPF map contents, potentially leading to information leakage or system instability.

  • Which versions of the Linux kernel are affected by CVE-2025-21853?

    CVE-2025-21853 affects certain versions of the Linux kernel prior to the patch being applied.

  • Is there a detailed technical explanation for CVE-2025-21853?

    CVE-2025-21853 involves an issue with the freeze_mutex during mmap operations in BPF, leading to potential race conditions.

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.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203