Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: Enzo Matsumiya <ematsumiya@suse.de>
Cc: Bharath SM <bharathsm.hsk@gmail.com>,
	linux-cifs@vger.kernel.org, sprasad@microsoft.com,
	smfrench@gmail.com, Bharath SM <bharathsm@microsoft.com>
Subject: Re: [PATCH 3/3] smb: client: show directory lease state in /proc/fs/cifs/open_dirs
Date: Thu, 30 Oct 2025 19:14:14 -0300	[thread overview]
Message-ID: <c13f6f90a69c6079c30353d24f0c2bc8@manguebit.org> (raw)
In-Reply-To: <iqf7l4ymr4pebuxkuxdklftctcctvfhilivf6zvtxqgwf5cics@ztoabwasr4md>

Enzo Matsumiya <ematsumiya@suse.de> writes:

> On 10/30, Paulo Alcantara wrote:
>>Bharath SM <bharathsm.hsk@gmail.com> writes:
>>
>>> Expose the SMB directory lease bits in the cached-dir proc
>>> output for debugging purposes.
>>>
>>> Signed-off-by: Bharath SM <bharathsm@microsoft.com>
>>> ---
>>>  fs/smb/client/cached_dir.c |  7 +++++++
>>>  fs/smb/client/cached_dir.h |  1 +
>>>  fs/smb/client/cifs_debug.c | 23 +++++++++++++++++++----
>>>  3 files changed, 27 insertions(+), 4 deletions(-)
>>
>>Are you increasing cached_fid structure just for debugging purposes?
>>That makes no sense.
>>
>>cached_fid structure has a dentry pointer, so what about accessing lease
>>flags as below
>>
>>        u8 lease_state = CIFS_I(d_inode(cfid->dentry))->oplock;
>
> Also, I don't think we can even get anything different than RH caching
> for dirs.

Yes.

> Even on RH -> R lease breaks (IIRC this can happen), we don't handle it
> and cfid is gone anyway.

Yep, that can happen.  The code also doesn't seem to handle any sort of
reference count on the @cfid being dumped out, which would definitely
cause UAF.

  reply	other threads:[~2025-10-30 22:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30 17:01 [PATCH 1/3] smb: client: show smb lease key in open_files output Bharath SM
2025-10-30 17:01 ` [PATCH 2/3] smb: client: show smb lease key in open_dirs output Bharath SM
2025-10-30 17:01 ` [PATCH 3/3] smb: client: show directory lease state in /proc/fs/cifs/open_dirs Bharath SM
2025-10-30 21:56   ` Paulo Alcantara
2025-10-30 22:08     ` Enzo Matsumiya
2025-10-30 22:14       ` Paulo Alcantara [this message]
2025-10-31  3:18       ` Shyam Prasad N
2025-10-31 12:55         ` Enzo Matsumiya
2025-10-31 17:32           ` Steve French
2025-10-31  3:19     ` Shyam Prasad N
2025-10-31  7:31       ` Bharath SM

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=c13f6f90a69c6079c30353d24f0c2bc8@manguebit.org \
    --to=pc@manguebit.org \
    --cc=bharathsm.hsk@gmail.com \
    --cc=bharathsm@microsoft.com \
    --cc=ematsumiya@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox