CVE-2026-23127

Source
https://cve.org/CVERecord?id=CVE-2026-23127
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23127.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-23127
Downstream
Published
2026-02-14T15:09:56.237Z
Modified
2026-02-14T20:02:14.167315Z
Summary
perf: Fix refcount warning on event->mmap_count increment
Details

In the Linux kernel, the following vulnerability has been resolved:

perf: Fix refcount warning on event->mmap_count increment

When calling refcountinc(&event->mmapcount) inside perfmmaprb(), the following warning is triggered:

    refcount_t: addition on 0; use-after-free.
    WARNING: lib/refcount.c:25

PoC:

struct perf_event_attr attr = {0};
int fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0);
mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
int victim = syscall(__NR_perf_event_open, &attr, 0, -1, fd,
                     PERF_FLAG_FD_OUTPUT);
mmap(NULL, 0x3000, PROT_READ | PROT_WRITE, MAP_SHARED, victim, 0);

This occurs when creating a group member event with the flag PERFFLAGFD_OUTPUT. The group leader should be mmap-ed and then mmap-ing the event triggers the warning.

Since the event has copied the outputevent in perfeventsetoutput(), event->rb is set. As a result, perfmmaprb() calls refcountinc(&event->mmapcount) when event->mmap_count = 0.

Disallow the case when event->mmapcount = 0. This also prevents two events from updating the same userpage.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23127.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
448f97fba9013ffa13f5dd82febd18836b189499
Fixed
23c0e4bd93d0b250775162faf456470485ac9fc7
Fixed
d06bf78e55d5159c1b00072e606ab924ffbbad35

Affected versions

v6.*
v6.17
v6.17-rc2
v6.17-rc3
v6.17-rc4
v6.17-rc5
v6.17-rc6
v6.17-rc7
v6.18
v6.18-rc1
v6.18-rc2
v6.18-rc3
v6.18-rc4
v6.18-rc5
v6.18-rc6
v6.18-rc7
v6.18.1
v6.18.2
v6.18.3
v6.18.4
v6.18.5
v6.18.6
v6.18.7
v6.19-rc1
v6.19-rc2
v6.19-rc3
v6.19-rc4
v6.19-rc5
v6.19-rc6

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23127.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.18.0
Fixed
6.18.8

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23127.json"