CVE-2025-39877

EUVD-2025-30868
In the Linux kernel, the following vulnerability has been resolved:

mm/damon/sysfs: fix use-after-free in state_show()

state_show() reads kdamond->damon_ctx without holding damon_sysfs_lock. 
This allows a use-after-free race:

CPU 0                         CPU 1
-----                         -----
state_show()                  damon_sysfs_turn_damon_on()
ctx = kdamond->damon_ctx;     mutex_lock(&damon_sysfs_lock);
                              damon_destroy_ctx(kdamond->damon_ctx);
                              kdamond->damon_ctx = NULL;
                              mutex_unlock(&damon_sysfs_lock);
damon_is_running(ctx);        /* ctx is freed */
mutex_lock(&ctx->kdamond_lock); /* UAF */

(The race can also occur with damon_sysfs_kdamonds_rm_dirs() and
damon_sysfs_kdamond_release(), which free or replace the context under
damon_sysfs_lock.)

Fix by taking damon_sysfs_lock before dereferencing the context, mirroring
the locking used in pid_show().

The bug has existed since state_show() first accessed kdamond->damon_ctx.
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTPrimary
7.8 HIGH
LOCAL
LOW
LOW
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Base Score
CVSS 3.x
EPSS Score
Percentile: 3%
Affected Products (NVD)
VendorProductVersion
linuxlinux_kernel
5.18 ≤
𝑥
< 6.1.153
linuxlinux_kernel
6.2 ≤
𝑥
< 6.6.107
linuxlinux_kernel
6.7 ≤
𝑥
< 6.12.48
linuxlinux_kernel
6.13 ≤
𝑥
< 6.16.8
linuxlinux_kernel
6.17:rc1
linuxlinux_kernel
6.17:rc2
linuxlinux_kernel
6.17:rc3
linuxlinux_kernel
6.17:rc4
linuxlinux_kernel
6.17:rc5
debiandebian_linux
11.0
𝑥
= Vulnerable software versions
Debian logo
Debian Releases
Debian Product
Codename
linux
bookworm
6.1.170-3
fixed
bookworm (security)
6.1.176-1
fixed
bullseye
5.10.223-1
fixed
bullseye (security)
5.10.259-1
fixed
forky
7.0.13-1
fixed
sid
7.1.3-1
fixed
trixie
6.12.86-1
fixed
trixie (security)
6.12.95-1
fixed
linux-6.1
bullseye (security)
6.1.176-1~deb11u1
fixed
Amazon Linux logo
Amazon Linux Releases
Amazon Package
Release
bpftool
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
bpftool-debuginfo
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
bpftool6.12
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
bpftool6.12-debuginfo
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-debuginfo
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-debuginfo-common-aarch64
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-debuginfo-common-x86_64
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-devel
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-headers
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-libbpf
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-libbpf-debuginfo
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-libbpf-devel
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-libbpf-static
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-livepatch-6.1.155-176.282
Amazon Linux 2023
1:1.0-0.amzn2023
fixed
kernel-livepatch-6.12.48-67.114
Amazon Linux 2023
1:1.0-0.amzn2023
fixed
kernel-modules-extra
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-modules-extra-common
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-tools
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-tools-debuginfo
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel-tools-devel
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
kernel6.12
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-debuginfo
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-debuginfo-common-aarch64
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-debuginfo-common-x86_64
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-devel
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-headers
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-libbpf
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-libbpf-debuginfo
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-libbpf-devel
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-libbpf-static
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-modules-extra
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-modules-extra-common
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-tools
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-tools-debuginfo
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
kernel6.12-tools-devel
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
perf
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
perf-debuginfo
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
perf6.12
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
perf6.12-debuginfo
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
python3-perf
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
python3-perf-debuginfo
Amazon Linux 2023
1:6.1.155-176.282.amzn2023
fixed
python3-perf6.12
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed
python3-perf6.12-debuginfo
Amazon Linux 2023
1:6.12.48-67.114.amzn2023
fixed