CVE-2026-46121: mm/damon/sysfs-schemes: protect memcg_path kfree() with damon_sysfs_lock

Published May 28, 2026
·
Updated

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

mm/damon/sysfs-schemes: protect memcgpath kfree() with damonsysfslock

Patch series "mm/damon/sysfs-schemes: fix use-after-free for [memcg]path".

Reads of 'memcgpath' and 'path' files in DAMON sysfs interface could race with their writes, results in use-after-free. Fix those.

This patch (of 2):

damonsysfsschemefilter->mmecgpath can be read and written by users, via DAMON sysfs memcgpath file. It can also be indirectly read, for the parameters {on,off}line committing to DAMON. The reads for parameters committing are protected by damonsysfslock to avoid the sysfs files being destroyed while any of the parameters are being read. But the user-driven direct reads and writes are not protected by any lock, while the write is deallocating the memcgpath-pointing buffer. As a result, the readers could read the already freed buffer (user-after-free). Note that the user-reads don't race when the same open file is used by the writer, due to kernfs's open file locking. Nonetheless, doing the reads and writes with separate open files would be common. Fix it by protecting both the user-direct reads and writes with damonsysfslock.

Affected Software

12 affected components
Linux Linux kernel
Linux Linux kernel>=6.6.96<6.6.140
Linux Linux kernel>=6.12.36<6.12.88
Linux Linux kernel>=6.15.5<6.16
Linux Linux kernel>=6.16.1<6.18.30
Linux Linux kernel>=6.19<7.0.7
Linux Linux kernel=6.16
Linux Linux kernel=6.16-rc4
Linux Linux kernel=6.16-rc5
Linux Linux kernel=6.16-rc6
Linux Linux kernel=6.16-rc7
Linux Linux kernel=7.1-rc1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Apply the patch from the series 'mm/damon/sysfs-schemes: fix use-after-free for [memcg_]path' (this patch is described as 'This patch (of 2)') so that memcg_path kfree() is performed while holding damon_sysfs_lock to prevent use-after-free when users read or write the memcg_path sysfs file.

    Linux kernel (mm/damon/sysfs-schemes) memcg_path kfree() protection = protect with damon_sysfs_lock
  2. Configuration

    Ensure DAMON sysfs interface serializes user-direct reads, writes, and parameter committing (for 'memcg_path' and 'path' files) under damon_sysfs_lock so that readers cannot observe freed buffers and writers cannot free buffers while reads are in progress (as fixed by the 'mm/damon/sysfs-schemes: fix use-after-free for [memcg_]path' patch series).

    Linux kernel (mm/damon/sysfs-schemes) DAMON sysfs parameter reads/writes serialization = serialize reads and writes with damon_sysfs_lock

Event History

May 28, 2026
CVE Published
via MITRE·09:35 AM
Data Sourced
via MITRE·09:35 AM
Description
Data Sourced
via NVD·10:16 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Systems exposing and using the DAMON sysfs interface are affected when concurrent access occurs to the memcg_path or path files. The race is relevant when reads and writes are performed through separate open sysfs file handles.

2

What does an attacker need to do to trigger the vulnerability?

An attacker needs local, low-privileged access sufficient to read from and write to the relevant DAMON sysfs files. They must race a read against a write that deallocates the path buffer, producing a use-after-free condition.

3

Does using the same open sysfs file for reads and writes avoid the race?

Yes. Reads and writes through the same open file do not race because of kernfs open-file locking. This does not protect accesses made through separate open file handles.

4

What is the fix?

The resolved fix protects direct user reads and writes of memcg_path with damon_sysfs_lock, preventing a reader from accessing the buffer after a concurrent write frees it. The advisory also describes a related fix for the DAMON path file.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203