CVE-2022-49607 json
perf/core: Fix data race between perf_event_set_output() and perf_mmap_close()
published 2025-02-26 20 mo ago modified 2026-06-17 4 mo ago also EUVD-2022-54625
- cvss
- 4.7
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 8%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Fix data race between perf_event_set_output() and perf_mmap_close()
Yang Jihing reported a race between perf_event_set_output() and perf_mmap_close():
CPU1 CPU2
perf_mmap_close(e2) if (atomic_dec_and_test(&e2->rb->mmap_count)) // 1 - > 0 detach_rest = true
ioctl(e1, IOC_SET_OUTPUT, e2) perf_event_set_output(e1, e2)
... list_for_each_entry_rcu(e, &e2->rb->event_list, rb_entry) ring_buffer_attach(e, NULL); // e1 isn't yet added and // therefore not detached
ring_buffer_attach(e1, e2->rb) list_add_rcu(&e1->rb_entry, &e2->rb->event_list)
After this; e1 is attached to an unmapped rb and a subsequent perf_mmap() will loop forever more:
again: mutex_lock(&e->mmap_mutex); if (event->rb) { ... if (!atomic_inc_not_zero(&e->rb->mmap_count)) { ... mutex_unlock(&e->mmap_mutex); goto again; } }
The loop in perf_mmap_close() holds e2->mmap_mutex, while the attach in perf_event_set_output() holds e1->mmap_mutex. As such there is no serialization to avoid this race.
Change perf_event_set_output() to take both e1->mmap_mutex and e2->mmap_mutex to alleviate that problem. Additionally, have the loop in perf_mmap() detach the rb directly, this avoids having to wait for the concurrent perf_mmap_close() to get around to doing it to make progress.
Patch / fix
- Linux Linux 3.3, 3.5, 3.10, 4.9.325, 4.14.290, 4.19.254, 5.4.208, 5.10.134, 5.15.58, 5.18.15, 5.19
- linux Debian 14, Debian 13, Debian 12 5.18.16-1
debian advisories DEBIAN-CVE-2022-49607
- linux Ubuntu 18.04 LTS 4.15.0-197.208
- linux Ubuntu 20.04 LTS 5.4.0-128.144
- linux Ubuntu 22.04 LTS 5.15.0-50.56
- linux-aws Ubuntu 18.04 LTS 4.15.0-1143.155
- linux-aws Ubuntu 20.04 LTS 5.4.0-1086.93
- linux-aws Ubuntu 22.04 LTS 5.15.0-1021.25
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1090.98
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1019.25
ubuntu advisories UBUNTU-CVE-2022-49607
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-64kb SLES 15 SP5-LTSS, SLE High Performance Computing 15 SP5-LTSS, SLE High Performance Computing 15 SP5-ESPOS 5.14.21-150500.55.100.1
- kernel-syms SLES for SAP 15 SP5, SLES 15 SP5-LTSS, SLE High Performance Computing 15 SP5-LTSS +1 more 5.14.21-150500.55.100.1
- kernel-source SLES for SAP 15 SP5, SLES 15 SP5-LTSS, SLE Micro 5.5 +2 more 5.14.21-150500.55.100.1
- kernel-default SLES for SAP 15 SP5, SLES 15 SP5-LTSS, SLE Micro 5.5 +3 more 5.14.21-150500.55.100.1
- kernel-obs-build SLES for SAP 15 SP5, SLES 15 SP5-LTSS, SLE High Performance Computing 15 SP5-LTSS +1 more 5.14.21-150500.55.100.1
- kernel-default-base SLES for SAP 15 SP5, SLES 15 SP5-LTSS, SLE Micro 5.5 +2 more 5.14.21-150500.55.100.1.150500.6.47.1
- kernel-rt SLE Micro 5.4, SLE Micro 5.3 5.14.21-150400.15.115.1
- kernel-source-rt SLE Micro 5.4, SLE Micro 5.3 5.14.21-150400.15.115.1
suse advisories SUSE-SU-2025:1293-1SUSE-SU-2025:1241-1SUSE-SU-2025:1183-1SUSE-SU-2025:1176-1SUSE-SU-2025:1027-1
- git.kernel.org/stable/c/3bbd868099287ff9027db59029b502fcfa2202a0 commit
- git.kernel.org/stable/c/f836f9ac95df15f1e0af4beb0ec20021e8c91998 commit
- git.kernel.org/stable/c/17f5417194136517ee9bbd6511249e5310e5617c commit
- git.kernel.org/stable/c/98c3c8fd0d4c560e0f8335b79c407bbf7fc9462c commit
- git.kernel.org/stable/c/43128b3eee337824158f34da6648163d2f2fb937 commit
- git.kernel.org/stable/c/da3c256e2d0ebc87c7db0c605c9692b6f1722074 commit
- git.kernel.org/stable/c/a9391ff7a7c5f113d6f2bf6621d49110950de49c commit
- git.kernel.org/stable/c/68e3c69803dada336893640110cb87221bb01dcf commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-49607 updated cvss 5.5
kernel: perf/core: Fix data race between perf_event_set_output() and perf_mmap_close()
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 moreaffected: no fix available
-
Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 13 mo ago
Exploit prediction
0.19% chance of exploitation in the next 30 days, higher than 8% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 4.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 3.1 | 4.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
| CNA | 3.1 | 4.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization
- Technology feeds
References
-
git.kernel.org
/stable/c/3bbd868099287ff9027db59029b502fcfa2202a0
patch
-
git.kernel.org
/stable/c/f836f9ac95df15f1e0af4beb0ec20021e8c91998
patch
-
git.kernel.org
/stable/c/17f5417194136517ee9bbd6511249e5310e5617c
patch
-
git.kernel.org
/stable/c/98c3c8fd0d4c560e0f8335b79c407bbf7fc9462c
patch
-
git.kernel.org
/stable/c/43128b3eee337824158f34da6648163d2f2fb937
patch
-
git.kernel.org
/stable/c/da3c256e2d0ebc87c7db0c605c9692b6f1722074
patch
-
git.kernel.org
/stable/c/a9391ff7a7c5f113d6f2bf6621d49110950de49c
patch
-
git.kernel.org
/stable/c/68e3c69803dada336893640110cb87221bb01dcf
patch
Sources
- CVE List CVE-2022-49607
- NVD CVE-2022-49607
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.