Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: Henrique Carvalho <henrique.carvalho@suse.com>, smfrench@gmail.com
Cc: ematsumiya@suse.de, sprasad@microsoft.com, paul@darkrain42.org,
	bharathsm@microsoft.com, linux-cifs@vger.kernel.org,
	Henrique Carvalho <henrique.carvalho@suse.com>
Subject: Re: [PATCH v3] smb: client: fix race in smb2_close_cached_fid()
Date: Tue, 27 May 2025 16:06:01 -0300	[thread overview]
Message-ID: <44fb26b3d061287bf1cf8ec458adc8a2@manguebit.com> (raw)
In-Reply-To: <20250527184213.101642-1-henrique.carvalho@suse.com>

Henrique Carvalho <henrique.carvalho@suse.com> writes:

> find_or_create_cached_dir() could grab a new reference after kref_put()
> had seen the refcount drop to zero but before cfid_list_lock is acquired
> in smb2_close_cached_fid(), leading to use-after-free.
>
> Switch to kref_put_lock() so cfid_release() runs with cfid_list_lock
> held, closing that gap.

Does this mean that SMB2_close() will be called with @cfid_list_lock
held?  If so, that's wrong.

  reply	other threads:[~2025-05-27 19:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 18:42 [PATCH v3] smb: client: fix race in smb2_close_cached_fid() Henrique Carvalho
2025-05-27 19:06 ` Paulo Alcantara [this message]
2025-05-27 19:18   ` Henrique Carvalho
2025-05-27 19:29     ` Paulo Alcantara

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=44fb26b3d061287bf1cf8ec458adc8a2@manguebit.com \
    --to=pc@manguebit.com \
    --cc=bharathsm@microsoft.com \
    --cc=ematsumiya@suse.de \
    --cc=henrique.carvalho@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=paul@darkrain42.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