aboutsummaryrefslogtreecommitdiff
path: root/lib/memory-notifier-error-inject.c
diff options
context:
space:
mode:
authorSeongJae Park <[email protected]>2022-11-07 16:50:00 +0000
committerAndrew Morton <[email protected]>2022-11-08 15:57:25 -0800
commit1de09a7281edecfdba19b3a07417f6d65243ab5f (patch)
treec23ae2757982982d8ce6b67e794df94e5bf5bc18 /lib/memory-notifier-error-inject.c
parent7dc5ba6254bb242a9f45e43549171a2d84d25e6a (diff)
mm/damon/dbgfs: check if rm_contexts input is for a real context
A user could write a name of a file under 'damon/' debugfs directory, which is not a user-created context, to 'rm_contexts' file. In the case, 'dbgfs_rm_context()' just assumes it's the valid DAMON context directory only if a file of the name exist. As a result, invalid memory access could happen as below. Fix the bug by checking if the given input is for a directory. This check can filter out non-context inputs because directories under 'damon/' debugfs directory can be created via only 'mk_contexts' file. This bug has found by syzbot[1]. [1] https://lore.kernel.org/damon/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Fixes: 75c1c2b53c78 ("mm/damon/dbgfs: support multiple contexts") Signed-off-by: SeongJae Park <[email protected]> Reported-by: [email protected] Cc: <[email protected]> [5.15.x] Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions