All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] mm/damon: allow NULL or unstarted damon_ctx parameter for damon_call()
@ 2026-08-13  3:49 SJ Park
  2026-08-13  3:49 ` [RFC PATCH 1/4] mm/damon/core: handle NULL ctx parameter in damon_call() SJ Park
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: SJ Park @ 2026-08-13  3:49 UTC (permalink / raw)
  Cc: SJ Park, Andrew Morton, damon, linux-kernel, linux-mm

Callers of damon_call() should validate the damon_ctx object parameter.
If it is NULL or never damon_start()-ed object, damon_call() could
dereference the NULL pointer or indefinitely hang.  Ensuring all callers
doing the validation correctly has turned out to be difficult.  Handle
the corner cases inside the core layer and remove callers' validations.

Patches 1 and 2 respectively allow passing NULL and not yet
damon_start()-ed ctx parameter to damon_call().  Patches 3 and 4 remove
the callers side validations in DMON_RECLAIM and DASMON_LRU_SORT,
respectively.

SJ Park (4):
  mm/damon/core: handle NULL ctx parameter in damon_call()
  mm/damon/core: set ctx->call_controls_obsolete in damon_new_ctx()
  mm/damon/reclaim: remove unnecessary damon_call() param validation
  mm/damon/lru_sort: remove unnecessary damon_call() param validation

 mm/damon/core.c     | 7 +++----
 mm/damon/lru_sort.c | 8 --------
 mm/damon/reclaim.c  | 8 --------
 3 files changed, 3 insertions(+), 20 deletions(-)


base-commit: c8520e181a2aaf85290d0447656de0df112dbbea
-- 
2.47.3

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-08-13 15:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13  3:49 [RFC PATCH 0/4] mm/damon: allow NULL or unstarted damon_ctx parameter for damon_call() SJ Park
2026-08-13  3:49 ` [RFC PATCH 1/4] mm/damon/core: handle NULL ctx parameter in damon_call() SJ Park
2026-08-13  3:58   ` sashiko-bot
2026-08-13  8:33   ` Gutierrez Asier
2026-08-13 13:55     ` SJ Park
2026-08-13 14:27       ` Gutierrez Asier
2026-08-13 15:12         ` SJ Park
2026-08-13  3:49 ` [RFC PATCH 2/4] mm/damon/core: set ctx->call_controls_obsolete in damon_new_ctx() SJ Park
2026-08-13  4:02   ` sashiko-bot
2026-08-13  4:10     ` SJ Park
2026-08-13  3:49 ` [RFC PATCH 3/4] mm/damon/reclaim: remove unnecessary damon_call() param validation SJ Park
2026-08-13  4:01   ` sashiko-bot
2026-08-13  4:11     ` SJ Park
2026-08-13  3:49 ` [RFC PATCH 4/4] mm/damon/lru_sort: " SJ Park
2026-08-13  4:04   ` sashiko-bot
2026-08-13  4:12     ` SJ Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.