From: Jeff Layton <jlayton@kernel.org>
To: chuck.lever@oracle.com
Cc: neilb@suse.de, linux-nfs@vger.kernel.org
Subject: [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation
Date: Thu, 14 Jul 2022 11:28:16 -0400 [thread overview]
Message-ID: <20220714152819.128276-1-jlayton@kernel.org> (raw)
Here's a first stab at a patchset to close a potential race when setting
a delegation on a file. Between the point where we open the file and
where we set the delegation, another task or client could unlink or
rename the dentry. If that occurs, we shouldn't hand out a delegation
in the open response, but we don't prevent that today.
The basic idea here is to re-do the lookup after setting the delegation.
If the resulting dentry is not the one we have in the open, then we can
reject handing out a delegation.
Only lightly tested, so this is an RFC for now.
Jeff Layton (3):
nfsd: drop fh argument from alloc_init_deleg
nfsd: rework arguments to nfs4_set_delegation
nfsd: vet the opened dentry after setting a delegation
fs/nfsd/nfs4state.c | 65 ++++++++++++++++++++++++++++++++++++++-------
1 file changed, 55 insertions(+), 10 deletions(-)
--
2.36.1
next reply other threads:[~2022-07-14 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 15:28 Jeff Layton [this message]
2022-07-14 15:28 ` [RFC PATCH 1/3] nfsd: drop fh argument from alloc_init_deleg Jeff Layton
2022-07-14 15:28 ` [RFC PATCH 2/3] nfsd: rework arguments to nfs4_set_delegation Jeff Layton
2022-07-14 16:47 ` Chuck Lever III
2022-07-14 17:12 ` Jeff Layton
2022-07-14 17:14 ` Chuck Lever III
2022-07-14 18:59 ` Jeff Layton
2022-07-14 15:28 ` [RFC PATCH 3/3] nfsd: vet the opened dentry after setting a delegation Jeff Layton
2022-07-14 16:53 ` Chuck Lever III
2022-07-14 17:11 ` Jeff Layton
2022-07-14 17:16 ` Chuck Lever III
2022-07-14 18:49 ` Jeff Layton
2022-07-18 21:18 ` [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation J. Bruce Fields
2022-07-18 21:43 ` Jeff Layton
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=20220714152819.128276-1-jlayton@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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