{"id":"CVE-2026-23127","aliases":["CVE-2026-23127"],"related":[],"kind":"vulnerability","state":"published","title":"perf: Fix refcount warning on event->mmap_count increment","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix refcount warning on event->mmap_count increment\n\nWhen calling refcount_inc(&event->mmap_count) inside perf_mmap_rb(), the\nfollowing warning is triggered:\n\n        refcount_t: addition on 0; use-after-free.\n        WARNING: lib/refcount.c:25\n\nPoC:\n\n    struct perf_event_attr attr = {0};\n    int fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0);\n    mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n    int victim = syscall(__NR_perf_event_open, &attr, 0, -1, fd,\n                         PERF_FLAG_FD_OUTPUT);\n    mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, victim, 0);\n\nThis occurs when creating a group member event with the flag\nPERF_FLAG_FD_OUTPUT. The group leader should be mmap-ed and then mmap-ing\nthe event triggers the warning.\n\nSince the event has copied the output_event in perf_event_set_output(),\nevent->rb is set. As a result, perf_mmap_rb() calls\nrefcount_inc(&event->mmap_count) when event->mmap_count = 0.\n\nDisallow the case when event->mmap_count = 0. This also prevents two\nevents from updating the same user_page.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nperf: Fix refcount warning on event->mmap_count increment\n\nWhen calling refcount_inc(&event->mmap_count) inside perf_mmap_rb(), the\nfollowing warning is triggered:\n\n        refcount_t: addition on 0; use-after-free.\n        WARNING: lib/refcount.c:25\n\nPoC:\n\n    struct perf_event_attr attr = {0};\n    int fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0);\n    mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n    int victim = syscall(__NR_perf_event_open, &attr, 0, -1, fd,\n                         PERF_FLAG_FD_OUTPUT);\n    mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, victim, 0);\n\nThis occurs when creating a group member event with the flag\nPERF_FLAG_FD_OUTPUT. The group leader should be mmap-ed and then mmap-ing\nthe event triggers the warning.\n\nSince the event has copied the output_event in perf_event_set_output(),\nevent->rb is set. As a result, perf_mmap_rb() calls\nrefcount_inc(&event->mmap_count) when event->mmap_count = 0.\n\nDisallow the case when event->mmap_count = 0. This also prevents two\nevents from updating the same user_page.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nperf: Corrección de la advertencia de refcount en el incremento de event-&gt;mmap_count\n\nAl llamar a refcount_inc(&amp;event-&gt;mmap_count) dentro de perf_mmap_rb(), se activa la siguiente advertencia:\n\n        refcount_t: adición en 0; uso después de liberación.\n        ADVERTENCIA: lib/refcount.c:25\n\nPoC:\n\n    struct perf_event_attr attr = {0};\n    int fd = syscall(__NR_perf_event_open, &amp;attr, 0, -1, -1, 0);\n    mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n    int victim = syscall(__NR_perf_event_open, &amp;attr, 0, -1, fd,\n                         PERF_FLAG_FD_OUTPUT);\n    mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, victim, 0);\n\nEsto ocurre al crear un evento miembro de grupo con la bandera PERF_FLAG_FD_OUTPUT. El líder del grupo debe ser mapeado con mmap y luego mapear el evento con mmap activa la advertencia.\n\nDado que el evento ha copiado el output_event en perf_event_set_output(), event-&gt;rb está establecido. Como resultado, perf_mmap_rb() llama a refcount_inc(&amp;event-&gt;mmap_count) cuando event-&gt;mmap_count = 0.\n\nNo permitir el caso cuando event-&gt;mmap_count = 0. Esto también evita que dos eventos actualicen la misma user_page.","source":"nvd"}],"published":"2026-02-14T15:09:56.237Z","modified":"2026-06-17T10:20:56.943Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"448f97fba9013ffa13f5dd82febd18836b189499","fixed":"23c0e4bd93d0b250775162faf456470485ac9fc7","status":"affected"},{"type":"git","introduced":"448f97fba9013ffa13f5dd82febd18836b189499","fixed":"d06bf78e55d5159c1b00072e606ab924ffbbad35","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.18","status":"unaffected"},{"type":"semver","introduced":"6.18.8","lastAffected":"6.18.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.19","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.18","fixed":"6.18.8"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/23c0e4bd93d0b250775162faf456470485ac9fc7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d06bf78e55d5159c1b00072e606ab924ffbbad35","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23127","url":"https://www.cve.org/CVERecord?id=CVE-2026-23127","licence":"CVE Terms of Use","modified":"2026-05-11T22:00:39.060Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23127","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23127","licence":"Public domain","modified":"2026-06-17T10:20:56.943Z"}],"updatedAt":"2026-11-25T22:59:13.878Z","epss":{"score":0.0012,"percentile":0.01993,"date":"2026-12-01T12:00:22.000Z"}}