mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Hyungjung Joo <jhj140711@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	jack@suse.cz, greg@kroah.com, linux-kernel@vger.kernel.org,
	viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs/mbcache: cancel shrink work before destroying the cache
Date: Tue, 17 Mar 2026 15:38:20 +0100	[thread overview]
Message-ID: <20260317-inventar-wirksam-11bc2443fabc@brauner> (raw)
In-Reply-To: <20260317054556.1821600-1-jhj140711@gmail.com>

On Tue, 17 Mar 2026 14:45:56 +0900, Hyungjung Joo wrote:
> mb_cache_destroy() calls shrinker_free() and then frees all cache
> entries and the cache itself, but it does not cancel the pending
> c_shrink_work work item first.
> 
> If mb_cache_entry_create() schedules c_shrink_work via schedule_work()
> and the work item is still pending or running when mb_cache_destroy()
> runs, mb_cache_shrink_worker() will access the cache after its memory
> has been freed, causing a use-after-free.
> 
> [...]


Pretty sure this is AI generated and it misses a Fixes: tag but otherwise looks
correct.

---

Applied to the vfs-7.1.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.1.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.1.misc

[1/1] fs/mbcache: cancel shrink work before destroying the cache
      https://git.kernel.org/vfs/vfs/c/d227786ab111

  reply	other threads:[~2026-03-17 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17  5:45 Hyungjung Joo
2026-03-17 14:38 ` Christian Brauner [this message]
2026-03-17 15:43   ` Hyungjung Joo
2026-03-18  9:42     ` Christian Brauner
2026-03-18 18:23 ` Jan Kara

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=20260317-inventar-wirksam-11bc2443fabc@brauner \
    --to=brauner@kernel.org \
    --cc=greg@kroah.com \
    --cc=jack@suse.cz \
    --cc=jhj140711@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®