CVE-2025-37747: perf: Fix hang while freeing sigtrap event

Published May 1, 2025
·
Updated

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

perf: Fix hang while freeing sigtrap event

Perf can hang while freeing a sigtrap event if a related deferred signal hadn't managed to be sent before the file got closed:

perfeventoverflow() taskworkadd(perfpendingtask)

fput() taskworkadd(fput())

taskworkrun() fput() perfrelease() perfeventreleasekernel() freeevent() perfpendingtasksync() taskworkcancel() -> FAILED rcuwaitwaitevent()

Once taskworkrun() is running, the list of pending callbacks is removed from the taskstruct and from this point on taskworkcancel() can't remove any pending and not yet started work items, hence the taskworkcancel() failure and the hang on rcuwaitwaitevent().

Task work could be changed to remove one work at a time, so a work running on the current task can always cancel a pending one, however the wait / wake design is still subject to inverted dependencies when remote targets are involved, as pictured by Oleg:

T1 T2

fd = perfeventopen(pid => T2->pid); fd = perfeventopen(pid => T1->pid); close(fd) close(fd) <IRQ> <IRQ> perfeventoverflow() perfeventoverflow() taskworkadd(perfpendingtask) taskworkadd(perfpendingtask) </IRQ> </IRQ> fput() fput() taskworkadd(fput()) taskworkadd(fput())

taskworkrun() taskworkrun() fput() fput() perfrelease() perfrelease() perfeventreleasekernel() perfeventreleasekernel() freeevent() freeevent() perfpendingtasksync() perfpendingtasksync() rcuwaitwaitevent() rcuwaitwaitevent()

Therefore the only option left is to acquire the event reference count upon queueing the perf task work and release it from the task work, just like it was done before 3a5465418f5f ("perf: Fix event leak upon exec and file release") but without the leaks it fixed.

Some adjustments are necessary to make it work:

A child event might dereference its parent upon freeing. Care must be taken to release the parent last.

Some places assuming the event doesn't have any reference held and therefore can be freed right away must instead put the reference and let the reference counting to its job.

Affected Software

13 affected components
Linux Linux kernel
Linux Linux kernel>=5.15.165<5.16
Linux Linux kernel>=6.1.103<6.2
Linux Linux kernel>=6.6.44<6.7
Linux Linux kernel>=6.10.3<6.12.24
Linux Linux kernel>=6.13<6.13.12
Linux Linux kernel>=6.14<6.14.3
Linux Linux kernel=6.15-rc1
Microsoft cbl2 kernel 5.15.186.1-1
Microsoft azl3 kernel 6.6.104.2-4
Microsoft azl3 kernel 6.6.112.1-2
Microsoft azl3 kernel 6.6.117.1-1
Microsoft azl3 kernel 6.6.119.3-1

Event History

May 1, 2025
CVE Published
via MITRE·12:55 PM
Data Sourced
via MITRE·12:55 PM
Description
Data Sourced
via NVD·01:15 PM
RemedyDescriptionSeverityAffected Software
Nov 7, 2025
Data Sourced
via Microsoft·01:01 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·01:01 AM
Affected Software
Updated
via Microsoft·09:01 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2025-37747?

CVE-2025-37747 has been assigned a severity level that indicates a significant risk to systems utilizing the affected Linux kernel.

2

How do I fix CVE-2025-37747?

To fix CVE-2025-37747, ensure that you update to the latest patched version of the Linux kernel.

3

What systems are affected by CVE-2025-37747?

CVE-2025-37747 affects various versions of the Linux kernel where the perf subsystem is utilized.

4

What causes the hang in CVE-2025-37747?

The hang in CVE-2025-37747 is caused by an issue where perf can hang while freeing a sigtrap event if the related deferred signal has not been sent.

5

Is CVE-2025-37747 remotely exploitable?

CVE-2025-37747 does not appear to be remotely exploitable, as it requires local access to the affected system.

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