{"id":"CVE-2025-37747","title":"perf: Fix hang while freeing sigtrap event","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix hang while freeing sigtrap event\n\nPerf can hang while freeing a sigtrap event if a related deferred\nsignal hadn't managed to be sent before the file got close…","severity":"none","vendor":"Linux","product":"Linux","affected":["Linux >= 104e258a004037bc7dba9f6085c71dad6af57ad4 < aae58a39ac4c63c3fa53536fb2504c9f1d0e1719","Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < fa1827fa968c0674e9b6fca223fa9fb4da4493eb","Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < 665b87b8f8b3aeb49083ef3b65c4953e7753fc12","Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < 1267bd38f161c1a27d9b722de017027167a225a0","Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < 56799bc035658738f362acec3e7647bb84e68933","Linux 9ad46f1fef421d43cdab3a7d1744b2f43b54dae0","Linux ed2c202dac55423a52d7e2290f2888bf08b8ee99","Linux f34d8307a73a18de5320fcc6f40403146d061891","Linux >= 6.6.44 < 6.6.160","Linux >= 5.15.165 < 5.16","Linux >= 6.1.103 < 6.2","Linux >= 6.10.3 < 6.11","Linux 6.11"],"published":"2025-05-01","updated":"2026-10-21","sourceUpdated":"2026-10-21T12:36:24.915Z","source":"CVEORG","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-37747","references":[{"url":"https://git.kernel.org/stable/c/aae58a39ac4c63c3fa53536fb2504c9f1d0e1719"},{"url":"https://git.kernel.org/stable/c/fa1827fa968c0674e9b6fca223fa9fb4da4493eb"},{"url":"https://git.kernel.org/stable/c/665b87b8f8b3aeb49083ef3b65c4953e7753fc12"},{"url":"https://git.kernel.org/stable/c/1267bd38f161c1a27d9b722de017027167a225a0"},{"url":"https://git.kernel.org/stable/c/56799bc035658738f362acec3e7647bb84e68933"}],"tags":["cve.org"],"epss":0.00248,"epssPercentile":0.16022,"ingestedAt":"2026-10-21T12:48:53.712Z","slug":"CVE-2025-37747","body":"## Overview\n\nIn the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix hang while freeing sigtrap event\n\nPerf can hang while freeing a sigtrap event if a related deferred\nsignal hadn't managed to be sent before the file got closed:\n\nperf_event_overflow()\n   task_work_add(perf_pending_task)\n\nfput()\n   task_work_add(____fput())\n\ntask_work_run()\n    ____fput()\n        perf_release()\n            perf_event_release_kernel()\n                _free_event()\n                    perf_pending_task_sync()\n                        task_work_cancel() -> FAILED\n                        rcuwait_wait_event()\n\nOnce task_work_run() is running, the list of pending callbacks is\nremoved from the task_struct and from this point on task_work_cancel()\ncan't remove any pending and not yet started work items, hence the\ntask_work_cancel() failure and the hang on rcuwait_wait_event().\n\nTask work could be changed to remove one work at a time, so a work\nrunning on the current task can always cancel a pending one, however\nthe wait / wake design is still subject to inverted dependencies when\nremote targets are involved, as pictured by Oleg:\n\nT1                                                      T2\n\nfd = perf_event_open(pid => T2->pid);                  fd = perf_event_open(pid => T1->pid);\nclose(fd)                                              close(fd)\n    <IRQ>                                                  <IRQ>\n    perf_event_overflow()                                  perf_event_overflow()\n       task_work_add(perf_pending_task)                        task_work_add(perf_pending_task)\n    </IRQ>                                                 </IRQ>\n    fput()                                                 fput()\n        task_work_add(____fput())                              task_work_add(____fput())\n\n    task_work_run()                                        task_work_run()\n        ____fput()                                             ____fput()\n            perf_release()                                         perf_release()\n                perf_event_release_kernel()                            perf_event_release_kernel()\n                    _free_event()                                          _free_event()\n                        perf_pending_task_sync()                               perf_pending_task_sync()\n                            rcuwait_wait_event()                                   rcuwait_wait_event()\n\nTherefore the only option left is to acquire the event reference count\nupon queueing the perf task work and release it from the task work, just\nlike it was done before 3a5465418f5f (\"perf: Fix event leak upon exec and file release\")\nbut without the leaks it fixed.\n\nSome adjustments are necessary to make it work:\n\n* A child event might dereference its parent upon freeing. Care must be\n  taken to release the parent last.\n\n* Some places assuming the event doesn't have any reference held and\n  therefore can be freed right away must instead put the reference and\n  let the reference counting to its job.\n\n## Affected\n\n- `Linux >= 104e258a004037bc7dba9f6085c71dad6af57ad4 < aae58a39ac4c63c3fa53536fb2504c9f1d0e1719`\n- `Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < fa1827fa968c0674e9b6fca223fa9fb4da4493eb`\n- `Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < 665b87b8f8b3aeb49083ef3b65c4953e7753fc12`\n- `Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < 1267bd38f161c1a27d9b722de017027167a225a0`\n- `Linux >= 3a5465418f5fd970e86a86c7f4075be262682840 < 56799bc035658738f362acec3e7647bb84e68933`\n- `Linux 9ad46f1fef421d43cdab3a7d1744b2f43b54dae0`\n- `Linux ed2c202dac55423a52d7e2290f2888bf08b8ee99`\n- `Linux f34d8307a73a18de5320fcc6f40403146d061891`\n- `Linux >= 6.6.44 < 6.6.160`\n- `Linux >= 5.15.165 < 5.16`\n- `Linux >= 6.1.103 < 6.2`\n- `Linux >= 6.10.3 < 6.11`\n- `Linux 6.11`\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.","depth":"sunlit","depthScore":3,"depthScoreParts":{"impact":2.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}