From: sashiko-bot@kernel.org
To: "SJ Park" <sj@kernel.org>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH 6.18.y] mm/damon/sysfs: read ops_id only once in damon_sysfs_apply_inputs()
Date: Wed, 09 Sep 2026 03:45:11 +0000 [thread overview]
Message-ID: <20260909034512.311211F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909032830.119383-1-sj@kernel.org>
> damon_sysfs_apply_inputs() reads ops_id twice. It could race with
> ops_id_store(). As a result, the min_region_sz could wrongly be set up.
> Read it once.
>
> The user impact is trivial. Sane users ain't update the parameter in
> parallel. Even if it happens, the DAMON core layer handles the wrong
> min_region_sz (!is_power_of_2()). Even if somehow the race ended up
> making a min_region_sz that is different from the user's intention but
> still valid, only monitoring itself runs differently than expected. No
> critical consequences like kernel panic or memory corruption happen
>
> The issue was discovered [1] by Sashiko.
>
> Link: https://lore.kernel.org/20260715031002.108504-7-sj@kernel.org
> Link: https://lore.kernel.org/20260703172417.95426-1-sj@kernel.org [1]
> Fixes: 8d009da32f13 ("mm/damon/sysfs: set damon_ctx->min_sz_region only for paddr use case")
> Signed-off-by: SJ Park <sj@kernel.org>
> Cc: <stable@vger.kernel.org> # 6.18.x
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> (cherry picked from commit 5adaaa28be8a79ddd7e103b171f9d6e14e7fc26e)
> Signed-off-by: SJ Park <sj@kernel.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909032830.119383-1-sj@kernel.org?part=1
next prev parent reply other threads:[~2026-09-09 3:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2026090858-arousal-getting-ee35@gregkh>
2026-09-09 3:28 ` [PATCH 6.18.y] mm/damon/sysfs: read ops_id only once in damon_sysfs_apply_inputs() SJ Park
2026-09-09 3:45 ` sashiko-bot [this message]
2026-09-09 13:01 ` Greg KH
2026-09-10 0:45 ` SJ Park
2026-09-10 0:41 ` SJ Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260909034512.311211F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=damon@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.