Linux Kernel up to 5.18.14 perf_event_set_output/perf_mmap_close buffer overflow

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
5.3$0-$5k0.00

Summaryinfo

A vulnerability was found in Linux Kernel up to 5.18.14. It has been classified as critical. Affected by this issue is the function perf_event_set_output/perf_mmap_close. The manipulation leads to buffer overflow. This vulnerability is referenced as CVE-2022-49607. No exploit is available. Upgrading the affected component is recommended.

Detailsinfo

A vulnerability, which was classified as critical, has been found in Linux Kernel up to 5.18.14. This issue affects the function perf_event_set_output/perf_mmap_close. The manipulation with an unknown input leads to a buffer overflow vulnerability. Using CWE to declare the problem leads to CWE-120. The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. Impacted is confidentiality, integrity, and availability. The summary by CVE is:

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.

It is possible to read the advisory at git.kernel.org. The identification of this vulnerability is CVE-2022-49607 since 02/26/2025. The exploitation is known to be easy. Technical details of the vulnerability are known, but there is no available exploit. The pricing for an exploit might be around USD $0-$5k at the moment (estimation calculated on 04/17/2025).

The vulnerability scanner Nessus provides a plugin with the ID 234545 (SUSE SLES12 Security Update : kernel (SUSE-SU-2025:1293-1)), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 4.9.325, 4.14.290, 4.19.254, 5.4.208, 5.10.134, 5.15.58 or 5.18.15 eliminates this vulnerability. Applying the patch 3bbd868099287ff9027db59029b502fcfa2202a0/f836f9ac95df15f1e0af4beb0ec20021e8c91998/17f5417194136517ee9bbd6511249e5310e5617c/98c3c8fd0d4c560e0f8335b79c407bbf7fc9462c/43128b3eee337824158f34da6648163d2f2fb937/da3c256e2d0ebc87c7db0c605c9692b6f1722074/a9391ff7a7c5f113d6f2bf6621d49110950de49c/68e3c69803dada336893640110cb87221bb01dcf is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the vulnerability database at Tenable (234545). Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 5.5
VulDB Meta Temp Score: 5.3

VulDB Base Score: 5.5
VulDB Temp Score: 5.3
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Buffer overflow
CWE: CWE-120 / CWE-119
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Partially

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 234545
Nessus Name: SUSE SLES12 Security Update : kernel (SUSE-SU-2025:1293-1)

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: Kernel 4.9.325/4.14.290/4.19.254/5.4.208/5.10.134/5.15.58/5.18.15
Patch: 3bbd868099287ff9027db59029b502fcfa2202a0/f836f9ac95df15f1e0af4beb0ec20021e8c91998/17f5417194136517ee9bbd6511249e5310e5617c/98c3c8fd0d4c560e0f8335b79c407bbf7fc9462c/43128b3eee337824158f34da6648163d2f2fb937/da3c256e2d0ebc87c7db0c605c9692b6f1722074/a9391ff7a7c5f113d6f2bf6621d49110950de49c/68e3c69803dada336893640110cb87221bb01dcf

Timelineinfo

02/26/2025 🔍
02/26/2025 +0 days 🔍
02/26/2025 +0 days 🔍
04/17/2025 +50 days 🔍

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2022-49607 (🔍)
GCVE (CVE): GCVE-0-2022-49607
GCVE (VulDB): GCVE-100-297155

Entryinfo

Created: 02/26/2025 10:35
Updated: 04/17/2025 17:14
Changes: 02/26/2025 10:35 (58), 04/17/2025 17:14 (2)
Complete: 🔍
Committer: sany
Cache ID: 216::103

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!