From: sashiko-bot@kernel.org
To: "SJ Park" <sj@kernel.org>
Cc: damon@lists.linux.dev
Subject: Re: [RFC PATCH 6.1.y 2/2] mm/damon/sysfs: put target pids for apply_inputs() failure
Date: Wed, 28 Oct 2026 05:19:22 +0000 [thread overview]
Message-ID: <sashiko-outbox-187523@kernel.org> (raw)
In-Reply-To: <20261028051104.154232-3-sj@kernel.org>
> damon_sysfs_build_ctx() invokes damon_sysfs_apply_inputs() for setting
> damon_ctx object with user inputs. If it is configured for virtual
> address spaces monitoring, the setup also increases reference counts of
> monitoring target pids. If the setup is failed, damon_sysfs_build_ctx()
> deallocates the damon_ctx object without decreasing the reference counts
> of the pids. If the failure happened after increasing reference counts
> of pids, the pids can be leaked.
>
> Fix the leaks by decreasing the pid reference counts before deallocating
> the damon_ctx object.
>
> The issue was discovered [1] by Sashiko.
>
> [1] https://lore.kernel.org/20260730040740.140836-1-sj@kernel.org
>
> Fixes: 74bd8b7d2f8e ("mm/damon/sysfs: move targets setup code to a separated function")
> Cc: <stable@vger.kernel.org> # 5.19.x
> Signed-off-by: SJ Park <sj@kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261028051104.154232-1-sj@kernel.org?part=2
prev parent reply other threads:[~2026-10-28 5:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 5:11 [RFC PATCH 6.1.y 0/2] mm/damon/sysfs: fix pid leaks from wrong error handlings SJ Park
2026-10-28 5:11 ` [RFC PATCH 6.1.y 1/2] mm/damon/sysfs: put target pids for damon_start() failure SJ Park
2026-10-28 5:20 ` sashiko-bot
2026-10-28 5:11 ` [RFC PATCH 6.1.y 2/2] mm/damon/sysfs: put target pids for apply_inputs() failure SJ Park
2026-10-28 5:19 ` sashiko-bot [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=sashiko-outbox-187523@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox