{"schema":"/api/v1/schema/cve.json","api_version":"1","id":"CVE-2022-49607","published":"2025-02-26T07:01:36.180000Z","last_modified":"2026-06-17T05:18:36.740000Z","status":"Modified","cvss":{"version":"3.1","score":4.7,"severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","source":"nvd@nist.gov","primary":true},"auth":true,"cwes":["CWE-362"],"cpes":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"3.2.49","version_end_excluding":"3.3"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"3.4.52","version_end_excluding":"3.5"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"3.9.8","version_end_excluding":"4.9.325"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"4.10","version_end_excluding":"4.14.290"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"4.15","version_end_excluding":"4.19.254"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"4.20","version_end_excluding":"5.4.208"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.5","version_end_excluding":"5.10.134"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.11","version_end_excluding":"5.15.58"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.16","version_end_excluding":"5.18.15"},{"criteria":"cpe:2.3:o:linux:linux_kernel:5.19:rc1:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version":"5.19"},{"criteria":"cpe:2.3:o:linux:linux_kernel:5.19:rc2:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version":"5.19"},{"criteria":"cpe:2.3:o:linux:linux_kernel:5.19:rc3:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version":"5.19"},{"criteria":"cpe:2.3:o:linux:linux_kernel:5.19:rc4:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version":"5.19"},{"criteria":"cpe:2.3:o:linux:linux_kernel:5.19:rc5:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version":"5.19"},{"criteria":"cpe:2.3:o:linux:linux_kernel:5.19:rc6:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version":"5.19"}],"cpes_truncated":false,"vendors":["linux"],"products":["linux/linux_kernel"],"ssvc":{"exploitation":"none","automatable":"no","technical_impact":"partial"},"cat":"os","platform":"linux","eol":false,"packages":[],"severity":"medium","priority_score":28,"links":{"html_es":"/es/cve/CVE-2022-49607/","html_en":"/en/cve/CVE-2022-49607/","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2022-49607","cve_org":"https://www.cve.org/CVERecord?id=CVE-2022-49607"},"untrusted":{"vendor_name":"Linux","product_name":"Linux Kernel","desc_en":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf/core: Fix data race between perf_event_set_output() and perf_mmap_close()\n\nYang Jihing reported a race between perf_event_set_output() and\nperf_mmap_close():\n\n\tCPU1\t\t\t\t\tCPU2\n\n\tperf_mmap_close(e2)\n\t  if (atomic_dec_and_test(&e2->rb->mmap_count)) // 1 - > 0\n\t    detach_rest = true\n\n\t\t\t\t\t\tioctl(e1, IOC_SET_OUTPUT, e2)\n\t\t\t\t\t\t  perf_event_set_output(e1, e2)\n\n\t  ...\n\t  list_for_each_entry_rcu(e, &e2->rb->event_list, rb_entry)\n\t    ring_buffer_attach(e, NULL);\n\t    // e1 isn't yet added and\n\t    // therefore not detached\n\n\t\t\t\t\t\t    ring_buffer_attach(e1, e2->rb)\n\t\t\t\t\t\t      list_add_rcu(&e1->rb_entry,\n\t\t\t\t\t\t\t\t   &e2->rb->event_list)\n\nAfter this; e1 is attached to an unmapped rb and a subsequent\nperf_mmap() will loop forever more:\n\n\tagain:\n\t\tmutex_lock(&e->mmap_mutex);\n\t\tif (event->rb) {\n\t\t\t...\n\t\t\tif (!atomic_inc_not_zero(&e->rb->mmap_count)) {\n\t\t\t\t...\n\t\t\t\tmutex_unlock(&e->mmap_mutex);\n\t\t\t\tgoto again;\n\t\t\t}\n\t\t}\n\nThe loop in perf_mmap_close() holds e2->mmap_mutex, while the attach\nin perf_event_set_output() holds e1->mmap_mutex. As such there is no\nserialization to avoid this race.\n\nChange perf_event_set_output() to take both e1->mmap_mutex and\ne2->mmap_mutex to alleviate that problem. Additionally, have the loop\nin perf_mmap() detach the rb directly, this avoids having to wait for\nthe concurrent perf_mmap_close() to get around to doing it to make\nprogress.","affected":[{"untrusted_vendor":"Linux","untrusted_product":"Linux"}],"references":[{"url":"https://git.kernel.org/stable/c/17f5417194136517ee9bbd6511249e5310e5617c","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/3bbd868099287ff9027db59029b502fcfa2202a0","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/43128b3eee337824158f34da6648163d2f2fb937","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/68e3c69803dada336893640110cb87221bb01dcf","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/98c3c8fd0d4c560e0f8335b79c407bbf7fc9462c","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/a9391ff7a7c5f113d6f2bf6621d49110950de49c","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/da3c256e2d0ebc87c7db0c605c9692b6f1722074","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/f836f9ac95df15f1e0af4beb0ec20021e8c91998","tags":["Patch"]}]}}