Skip to content

samples/damon: handle damon_{start,stop}() failures

SJ Park damon linux-mm lkml stable 1 version Applied

Status from this message: [merged mm-stable] samples-damon-prcl-stop-and-free-damon-ctx-when-damon_call-fails.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 3 repliesApplied 6/6

Changes from RFC v4 from the cover letter

- RFC v4: https://lore.kernel.org/[email protected]/
- Collect R-b: from Zenghui Yu.
- Rebase to latest mm-new.
- Drop RFC.

Patches in v1 All 6 applied

#Subject and filesSizeRepliesApplied
1/6samples/damon/wsse: handle damon_start() failuresamples/damon/wsse.c+3 -10 repliesApplied
2/6samples/damon/prcl: handle damon_start() failuresamples/damon/prcl.c+3 -10 repliesApplied
3/6samples/damon/mtier: handle damon_start() failuresamples/damon/mtier.c+10 -10 repliesApplied
4/6samples/damon/mtier: handle damon_stop() failuresamples/damon/mtier.c+2 -11 replyApplied
5/6samples/damon/wsse: stop and free damon ctx when damon_call() failssamples/damon/wsse.c+6 -10 repliesApplied
6/6samples/damon/prcl: stop and free damon ctx when damon_call() failssamples/damon/prcl.c+6 -10 repliesApplied

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchZenghui Yu
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] samples/damon: handle damon_{start,stop}() failures

All DAMON sample modules are not correctly handling failures from damon_start(). Among those, mtier also has an additional problem for handling of damon_stop() failures. wsse and prcl also have a problem in their damon_call() failure handling. As a result, memory leaks, next DAMON operation disruptions, and use-after-free can happen. Fix those.

Note that only the damon_start() failure caused issues can reliably be reproduced. Reproducing those issues require the admin permission, though.

Changes from RFC v4
- RFC v4: https://lore.kernel.org/[email protected]/
- Collect R-b: from Zenghui Yu.
- Rebase to latest mm-new.
- Drop RFC.
Changes from RFC v3
- RFC v3: https://lore.kernel.org/[email protected]
- Add damon_Call() failure handling fixes for wsse and prcl. Changes from RFC v2
- RFC v2: https://lore.kernel.org/[email protected]
- Add damon_start() failure handling fixes for wsse and prcl. Changes from RFC v1
- RFC v1: https://lore.kernel.org/[email protected]
- Add damon_stop() failure handling fix to the series.

SJ Park (6):
samples/damon/wsse: handle damon_start() failure samples/damon/prcl: handle damon_start() failure samples/damon/mtier: handle damon_start() failure samples/damon/mtier: handle damon_stop() failure samples/damon/wsse: stop and free damon ctx when damon_call() fails samples/damon/prcl: stop and free damon ctx when damon_call() fails

 samples/damon/mtier.c | 14 ++++++++++++--
 samples/damon/prcl.c  | 11 +++++++++--
 samples/damon/wsse.c  | 11 +++++++++--
 3 files changed, 30 insertions(+), 6 deletions(-)

base-commit: 77fe35dfe005f7d55c8e729e1543b87cfc805a21

Signature · 1 line
2.47.3