From: SJ Park <sj@kernel.org>
To: Aveline Noir <jm5905938@gmail.com>
Cc: SJ Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Lian Wang <lianux.mm@gmail.com>,
Dawei Li <set_pte_at@outlook.com>,
damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [PATCH] mm/damon/sysfs: skip registration if DAMON core init fails
Date: Mon, 23 Nov 2026 07:36:00 -0800 [thread overview]
Message-ID: <20261123153601.85440-1-sj@kernel.org> (raw)
In-Reply-To: <20261123-damon-sysfs-init-guard-v1-1-a2a6ca65693a@gmail.com>
On Mon, 23 Nov 2026 18:51:45 +1100 Aveline Noir <jm5905938@gmail.com> wrote:
> Hi SJ,
>
> Here's the sysfs fix I mentioned in the report queue review.
>
> -- >8 --
>
> While reviewing the DAMON report queue series, I noticed that DAMON
> sysfs still registers its interface if DAMON core initialization fails.
> If damon_init() fails to allocate damon_region_cache, starting a
> kdamond with an initial region can pass a NULL cache to
> kmem_cache_alloc() via damon_new_region().
"While reviewing ..." part seems unnecessary for git history. The user impact
(NULL dereference) could better be documented. What about below?
'''
DAMON sysfs registers ints interface even if DAMON core initialization fails.
If damon_init() fails to allocate damon_region_cache, starting a kdamond with
an initial region can pass a NULL cache to kmem_cache_alloc() via
damon_new_region(). As a result, NULL dereference can happen. The
initialization failure is unlikely, but the consequence is quite bad.
'''
>
> Check damon_initialized() before creating the DAMON sysfs directory and
> return -ENOMEM if the core is unavailable.
Thank you for finding and fixing the issue!
>
> Fixes: a18709442869 ("mm/damon: improve damon_new_region strategy")
> Signed-off-by: Aveline Noir <jm5905938@gmail.com>
Other than the above commit message,
Reviewed-by: SJ Park <sj@kernel.org>
With the above assumption, I applied this patch to damon/next [1] tree with the
commit message update. I will repost it soon (~1 week) as an mm.git merge
request. So, no action from your side is needed for now.
[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
Thanks,
SJ
[...]
prev parent reply other threads:[~2026-11-23 15:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 7:51 [PATCH] mm/damon/sysfs: skip registration if DAMON core init fails Aveline Noir
2026-11-23 15:36 ` SJ Park [this message]
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=20261123153601.85440-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=jm5905938@gmail.com \
--cc=lianux.mm@gmail.com \
--cc=linux-mm@kvack.org \
--cc=set_pte_at@outlook.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox