# CVE-2022-49783: x86/fpu: Drop fpregs lock before inheriting FPU permissions

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.18%, higher than 7% of CVEs (2026-12-01)
- Published: 2025-05-01T14:09:17.054Z
- Modified: 2026-11-05T20:17:11.143Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

x86/fpu: Drop fpregs lock before inheriting FPU permissions

Mike Galbraith reported the following against an old fork of preempt-rt
but the same issue also applies to the current preempt-rt tree.

   BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
   in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: systemd
   preempt_count: 1, expected: 0
   RCU nest depth: 0, expected: 0
   Preemption disabled at:
   fpu_clone
   CPU: 6 PID: 1 Comm: systemd Tainted: G            E       (unreleased)
   Call Trace:
    <TASK>
    dump_stack_lvl
    ? fpu_clone
    __might_resched
    rt_spin_lock
    fpu_clone
    ? copy_thread
    ? copy_process
    ? shmem_alloc_inode
    ? kmem_cache_alloc
    ? kernel_clone
    ? __do_sys_clone
    ? do_syscall_64
    ? __x64_sys_rt_sigprocmask
    ? syscall_exit_to_user_mode
    ? do_syscall_64
    ? syscall_exit_to_user_mode
    ? do_syscall_64
    ? syscall_exit_to_user_mode
    ? do_syscall_64
    ? exc_page_fault
    ? entry_SYSCALL_64_after_hwframe
    </TASK>

Mike says:

  The splat comes from fpu_inherit_perms() being called under fpregs_lock(),
  and us reaching the spin_lock_irq() therein due to fpu_state_size_dynamic()
  returning true despite static key __fpu_state_size_dynamic having never
  been enabled.

Mike's assessment looks correct. fpregs_lock on a PREEMPT_RT kernel disables
preemption so calling spin_lock_irq() in fpu_inherit_perms() is unsafe. This
problem exists since commit

  9e798e9aa14c ("x86/fpu: Prepare fpu_clone() for dynamically enabled features").

Even though the original bug report should not have enabled the paths at
all, the bug still exists.

fpregs_lock is necessary when editing the FPU registers or a task's FP
state but it is not necessary for fpu_inherit_perms(). The only write
of any FP state in fpu_inherit_perms() is for the new child which is
not running yet and cannot context switch or be borrowed by a kernel
thread yet. Hence, fpregs_lock is not protecting anything in the new
child until clone() completes and can be dropped earlier. The siglock
still needs to be acquired by fpu_inherit_perms() as the read of the
parent's permissions has to be serialised.

  [ bp: Cleanup splat. ]

(As written by CVE List.)

## Affected

- Linux Linux: from 9e798e9aa14c45fb94e47b30bf6347b369ce9df7 before c6e8a7a1780af3da65e78a615f7d0874da6aabb0; from 9e798e9aa14c45fb94e47b30bf6347b369ce9df7 before 36b038791e1e2baea892e9276588815fd14894b4; 5.16 (not affected: before 5.16; from 6.0.10 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 5.16 before 6.0.10; 6.1

## References

- <https://git.kernel.org/stable/c/c6e8a7a1780af3da65e78a615f7d0874da6aabb0> (patch)
- <https://git.kernel.org/stable/c/36b038791e1e2baea892e9276588815fd14894b4> (patch)

## Sources

- CVE List: [CVE-2022-49783](https://www.cve.org/CVERecord?id=CVE-2022-49783), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2022-49783](https://nvd.nist.gov/vuln/detail/CVE-2022-49783), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2022-49783 · Whole record: https://cve.day/CVE-2022-49783.json · Rebuilt by cve.day 2026-11-25T22:58:20.868Z
