Linux NFS development
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation
@ 2022-07-14 15:28 Jeff Layton
  2022-07-14 15:28 ` [RFC PATCH 1/3] nfsd: drop fh argument from alloc_init_deleg Jeff Layton
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jeff Layton @ 2022-07-14 15:28 UTC (permalink / raw)
  To: chuck.lever; +Cc: neilb, linux-nfs

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-07-18 21:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-14 15:28 [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation Jeff Layton
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox