mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Sandeep Dhavale <dhavale@google.com>,
	Shakeel Butt <shakeel.butt@linux.dev>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>,
	Christian Brauner <christian@brauner.io>,
	Meta kernel team <kernel-team@meta.com>,
	driver-core@lists.linux.dev, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] kernfs: Remove kernfs_rwsem from dentry revalidation
Date: Tue, 15 Sep 2026 10:33:22 +0800	[thread overview]
Message-ID: <3f5cfc95-8b09-424e-93c6-ec958daa1137@themaw.net> (raw)
In-Reply-To: <CAB=BE-S-fOqvjj5s=M588tdUDDgDMAxOF7SE6Sm-9vara3=snw@mail.gmail.com>

On 12/9/26 11:28, Sandeep Dhavale wrote:
> Hi Shakeel,
>> I don't see how reclaim can set dentry->d_inode = NULL for a dentry with
>> elevated dentry->d_lockref.count because kernfs_dop_revalidate gets the dentry
>> whose dentry->d_lockref.count is elevated. Reclaim specifically skips such
>> dentries.
> Thank you for your input! That may explain why I am unable to reproduce led by
> memory stress narrative. Let me attempt to reproduce this first and I
> will provide an update.

It looks possible the dentry isn't negative, instead it might be possible

it's a use after free of the inode. There are functions that are called

directly by file systems that use kernfs.


I always thought that was the reason for the lock, not so much a need to

synchronise with the VFS (eg. in ref-walk mode it's likely the inode read

lock is held).


I wonder if there's a concurrent remove going on when this happens?


You could enable debug logging and see if you can see any node removal log

messages. The logging isn't very chatty so it might be difficult to get

further context from it but it could provide a lead to follow up on.


Ian


  reply	other threads:[~2026-09-15  2:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  5:05 [PATCH 0/4] kernfs: remove " Shakeel Butt
2026-08-21  5:05 ` [PATCH 1/4] kernfs: Use VFS lookup context in d_revalidate() Shakeel Butt
2026-08-21  5:05 ` [PATCH 2/4] kernfs: Prepare directory revisions for lockless reads Shakeel Butt
2026-08-21  5:05 ` [PATCH 3/4] kernfs: Avoid namespace dereference in d_revalidate() Shakeel Butt
2026-08-21  5:05 ` [PATCH 4/4] kernfs: Remove kernfs_rwsem from dentry revalidation Shakeel Butt
2026-09-11 18:33   ` Sandeep Dhavale
2026-09-11 19:31     ` Shakeel Butt
2026-09-11 21:11       ` Sandeep Dhavale
2026-09-12  3:09         ` Shakeel Butt
2026-09-12  3:28           ` Sandeep Dhavale
2026-09-15  2:33             ` Ian Kent [this message]
2026-08-25 14:58 ` [PATCH 0/4] kernfs: remove " Christian Brauner
2026-08-26  4:02   ` Ian Kent

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=3f5cfc95-8b09-424e-93c6-ec958daa1137@themaw.net \
    --to=raven@themaw.net \
    --cc=cgroups@vger.kernel.org \
    --cc=christian@brauner.io \
    --cc=dhavale@google.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=tj@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

all inboxes | Powered by JetHome®