linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>, Shuah Khan <shuah@kernel.org>,
	damon@lists.linux.dev, kernel-team@meta.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org, stable@vger.kernel.org, #@kvack.org,
	6.3.x@kvack.org
Subject: [PATCH 0/2] mm/damon: fix memory leak in memcg_path sysfs file
Date: Thu, 19 Jun 2025 11:36:06 -0700	[thread overview]
Message-ID: <20250619183608.6647-1-sj@kernel.org> (raw)

Users can leak memory by repeatedly writing a string to DAMOS sysfs
memcg_path file.  Fix it (patch 1) and add a selftest (patch 2) to avoid
reoccurrance of the bug.

SeongJae Park (2):
  mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path
    on write
  selftets/damon: add a test for memcg_path leak

 mm/damon/sysfs-schemes.c                      |  1 +
 tools/testing/selftests/damon/Makefile        |  1 +
 .../selftests/damon/sysfs_memcg_path_leak.sh  | 43 +++++++++++++++++++
 3 files changed, 45 insertions(+)
 create mode 100755 tools/testing/selftests/damon/sysfs_memcg_path_leak.sh


base-commit: 05b89e828eb4f791f721cbdc65f36e1a8287a9d3
-- 
2.39.5


             reply	other threads:[~2025-06-19 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19 18:36 SeongJae Park [this message]
2025-06-19 18:36 ` [PATCH 1/2] mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write SeongJae Park
2025-06-19 18:36 ` [PATCH 2/2] selftets/damon: add a test for memcg_path leak SeongJae 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=20250619183608.6647-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=#@kvack.org \
    --cc=6.3.x@kvack.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    --cc=stable@vger.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