Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Security»Common Vulnerabilities and Exposures (CVEs)»CVE-2025-38170 – Linux kernel – arm64 FPSIMD SME Trap Handling Stale CPU State Vulnerability

    CVE-2025-38170 – Linux kernel – arm64 FPSIMD SME Trap Handling Stale CPU State Vulnerability

    July 3, 2025

    CVE ID : CVE-2025-38170

    Published : July 3, 2025, 9:15 a.m. | 2 hours, 14 minutes ago

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

    arm64/fpsimd: Discard stale CPU state when handling SME traps

    The logic for handling SME traps manipulates saved FPSIMD/SVE/SME state
    incorrectly, and a race with preemption can result in a task having
    TIF_SME set and TIF_FOREIGN_FPSTATE clear even though the live CPU state
    is stale (e.g. with SME traps enabled). This can result in warnings from
    do_sme_acc() where SME traps are not expected while TIF_SME is set:

    | /* With TIF_SME userspace shouldn’t generate any traps */
    | if (test_and_set_thread_flag(TIF_SME))
    | WARN_ON(1);

    This is very similar to the SVE issue we fixed in commit:

    751ecf6afd6568ad (“arm64/sve: Discard stale CPU state when handling SVE traps”)

    The race can occur when the SME trap handler is preempted before and
    after manipulating the saved FPSIMD/SVE/SME state, starting and ending on
    the same CPU, e.g.

    | void do_sme_acc(unsigned long esr, struct pt_regs *regs)
    | {
    | // Trap on CPU 0 with TIF_SME clear, SME traps enabled
    | // task->fpsimd_cpu is 0.
    | // per_cpu_ptr(&fpsimd_last_state, 0) is task.
    |
    | …
    |
    | // Preempted; migrated from CPU 0 to CPU 1.
    | // TIF_FOREIGN_FPSTATE is set.
    |
    | get_cpu_fpsimd_context();
    |
    | /* With TIF_SME userspace shouldn’t generate any traps */
    | if (test_and_set_thread_flag(TIF_SME))
    | WARN_ON(1);
    |
    | if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) {
    | unsigned long vq_minus_one =
    | sve_vq_from_vl(task_get_sme_vl(current)) – 1;
    | sme_set_vq(vq_minus_one);
    |
    | fpsimd_bind_task_to_cpu();
    | }
    |
    | put_cpu_fpsimd_context();
    |
    | // Preempted; migrated from CPU 1 to CPU 0.
    | // task->fpsimd_cpu is still 0
    | // If per_cpu_ptr(&fpsimd_last_state, 0) is still task then:
    | // – Stale HW state is reused (with SME traps enabled)
    | // – TIF_FOREIGN_FPSTATE is cleared
    | // – A return to userspace skips HW state restore
    | }

    Fix the case where the state is not live and TIF_FOREIGN_FPSTATE is set
    by calling fpsimd_flush_task_state() to detach from the saved CPU
    state. This ensures that a subsequent context switch will not reuse the
    stale CPU state, and will instead set TIF_FOREIGN_FPSTATE, forcing the
    new state to be reloaded from memory prior to a return to userspace.

    Note: this was originallly posted as [1].

    [ Rutland: rewrite commit message ]

    Severity: 0.0 | NA

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleCVE-2025-38171 – Linux Power Supply Driver Max77705 Workqueue Vulnerability
    Next Article CVE-2025-38169 – Linux Kernel ARM64 FPSIMD State Clobbering Vulnerability

    Related Posts

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-44658 – Netgear RAX30 PHP-FPM Misconfigured Extension Bypass Vulnerability

    July 22, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-7393 – Drupal Mail Login Authentication Bypass

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Bill Gates says “AI will replace humans for most things” in 20 years, including blue-and white-collar jobs — but floats short work weeks and early retirement as trade-offs

    News & Updates

    Tinkerwell v5 is now released

    Development

    PHP Core Undergoes Security Audit – Results Now Available

    Development

    I found the best Elden Ring Nightreign deal you’ll see before launch — save nearly $10 on FromSoftware’s co-op spinoff

    News & Updates

    Highlights

    suanPan – finite element method (FEM) simulation platform

    May 22, 2025

    suanPan is a finite element method (FEM) simulation platform for applications in fields such as…

    CVE-2025-4517 – Tarfile Filter Arbitrary File Write

    June 3, 2025

    Your interview is a sales call

    May 3, 2025

    CVE-2025-48782 – Soar Cloud HRD File Upload Command Execution Vulnerability

    June 6, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.