CWE
190
Advisory Published
Updated

CVE-2025-37858: fs/jfs: Prevent integer overflow in AG size calculation

First published: Fri May 09 2025(Updated: )

In the Linux kernel, the following vulnerability has been resolved: fs/jfs: Prevent integer overflow in AG size calculation The JFS filesystem calculates allocation group (AG) size using 1 << l2agsize in dbExtendFS(). When l2agsize exceeds 31 (possible with >2TB aggregates on 32-bit systems), this 32-bit shift operation causes undefined behavior and improper AG sizing. On 32-bit architectures: - Left-shifting 1 by 32+ bits results in 0 due to integer overflow - This creates invalid AG sizes (0 or garbage values) in sbi->bmap->db_agsize - Subsequent block allocations would reference invalid AG structures - Could lead to: - Filesystem corruption during extend operations - Kernel crashes due to invalid memory accesses - Security vulnerabilities via malformed on-disk structures Fix by casting to s64 before shifting: bmp->db_agsize = (s64)1 << l2agsize; This ensures 64-bit arithmetic even on 32-bit architectures. The cast matches the data type of db_agsize (s64) and follows similar patterns in JFS block calculation code. Found by Linux Verification Center (linuxtesting.org) with SVACE.

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

Affected SoftwareAffected VersionHow to fix
Linux kernel

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-37858?

    CVE-2025-37858 has been rated as a medium severity vulnerability due to potential integer overflow risks.

  • How do I fix CVE-2025-37858?

    To fix CVE-2025-37858, you should update your Linux kernel to the latest stable version where this issue has been patched.

  • What systems are affected by CVE-2025-37858?

    CVE-2025-37858 affects the Linux kernel, specifically systems utilizing the JFS filesystem.

  • What are the potential consequences of CVE-2025-37858?

    If exploited, CVE-2025-37858 could lead to filesystem corruption and instability in affected systems.

  • How can I determine if my Linux kernel is vulnerable to CVE-2025-37858?

    You can determine if your Linux kernel is vulnerable to CVE-2025-37858 by checking the kernel version against vulnerability disclosures and updates.

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