Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm/damon/dbgfs: protect targets destructions with kdamond_lock
commit 3479641 upstream. 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'. Link: https://lkml.kernel.org/r/[email protected] Reported-by: Sangwoo Bae <[email protected]> Fixes: 4bc0595 ("mm/damon: implement a debugfs-based user space interface") Signed-off-by: SeongJae Park <[email protected]> Cc: <[email protected]> [5.15.x] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information