From: Greg KH <gregkh@linuxfoundation.org>
To: SeongJae Park <sj@kernel.org>
Cc: stable@vger.kernel.org, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] mm/damon/dbgfs: protect targets destructions with kdamond_lock
Date: Mon, 27 Dec 2021 13:35:40 +0100 [thread overview]
Message-ID: <YcmzHCJYiYIMcyTH@kroah.com> (raw)
In-Reply-To: <20211226102632.836-1-sj@kernel.org>
On Sun, Dec 26, 2021 at 10:26:32AM +0000, SeongJae Park wrote:
> commit 34796417964b8d0aef45a99cf6c2d20cebe33733 upstream.
>
> DAMON debugfs interface iterates current monitoring targets in
> 'dbgfs_target_ids_read()' while holding the corresponding
> 'kdamond_lock'. However, it also destructs the monitoring targets in
> 'dbgfs_before_terminate()' without holding the lock. This can result in
> a use_after_free bug. This commit avoids the race by protecting the
> destruction with the corresponding 'kdamond_lock'.
>
> Link: https://lkml.kernel.org/r/20211221094447.2241-1-sj@kernel.org
> Reported-by: Sangwoo Bae <sangwoob@amazon.com>
> Fixes: 4bc05954d007 ("mm/damon: implement a debugfs-based user space interface")
> Signed-off-by: SeongJae Park <sj@kernel.org>
> Cc: <stable@vger.kernel.org> # 5.15.x
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
> This is a backport of a DAMON fix that merged in the mainline, for
> v5.15.x stable series.
Now queued up, thanks.
greg k-h
next prev parent reply other threads:[~2021-12-27 12:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-26 10:26 [PATCH] mm/damon/dbgfs: protect targets destructions with kdamond_lock SeongJae Park
2021-12-27 12:35 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-12-21 9:44 [PATCH] mm/damon/dbgfs: Protect " 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=YcmzHCJYiYIMcyTH@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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.