mm/damon/dbgfs: protect targets destructions with kdamond_lock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mm/damon/dbgfs: protect targets destructions with kdamond_lock
DAMON debugfs interface iterates current monitoring targets in 'dbgfs_target_ids_read()' while holding the corresponding 'kdamond_lock'. However, it also destructs the monitoring targets in 'dbgfs_before_terminate()' without holding the lock. This can result in a use_after_free bug. This commit avoids the race by protecting the destruction with the corresponding 'kdamond_lock'.
From the CVE record · Linux
The Linux kernel's DAMON debugfs interface can race when it reads monitoring targets while another operation destroys them without holding the same lock. An attacker who can trigger this race could cause a use-after-free. The input does not specify access requirements or whether user interaction is needed.
Engineers running Linux kernels with the DAMON debugfs interface should check their versions; affected versions are not specified.