All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Junxi Qian <qjx1298677004@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
	akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/damon/sysfs-schemes: fix use-after-free on memcg_path and goal path
Date: Tue, 21 Apr 2026 16:47:30 -0700	[thread overview]
Message-ID: <20260421234730.2917-1-sj@kernel.org> (raw)
In-Reply-To: <20260421070632.161808-1-qjx1298677004@gmail.com>

On Tue, 21 Apr 2026 15:06:32 +0800 Junxi Qian <qjx1298677004@gmail.com> wrote:

> Hi SJ,
> 
> Thanks for the suggestion.
> 
> I checked the show/store race further and was able to reproduce the
> memcg_path_show() side issue on a KASAN kernel.

Thank you for sharing this, Jinxi!

[...]
> I will spend some time thinking about how to fix this properly.
> 
> If someone more familiar with this code would like to work on the fix
> directly, that would be greatly appreciated, as I am not very familiar
> with this part of the code yet.

I think you could protect the memcg_path and path load/store() parts with the
damon_sysfs_lock, but using mutex_trylock() instead of mutex_lock(), as I
suggested.  If you prefer me to finish the remaining work, please feel free to
let me know.  If that's the case, I will work on the fix while adding
Co-developed-by: and Signed-off-by: tags of you on the fix, if you don't mind.


Thanks,
SJ

[...]

  reply	other threads:[~2026-04-21 23:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  8:53 [PATCH] mm/damon/sysfs-schemes: fix use-after-free on memcg_path and goal path Junxi Qian
2026-04-20 11:53 ` sashiko-bot
2026-04-20 12:54 ` [PATCH v2] " Junxi Qian
2026-04-20 18:31   ` sashiko-bot
2026-04-21  1:20   ` SeongJae Park
2026-04-21  1:23     ` SeongJae Park
2026-04-21 15:01     ` SeongJae Park
2026-04-21  7:06 ` [PATCH] " Junxi Qian
2026-04-21 23:47   ` SeongJae Park [this message]
2026-04-22  4:31     ` junxi qian
2026-04-22  4:35       ` 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=20260421234730.2917-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qjx1298677004@gmail.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 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.