Skip to content

Commit 0f26556

Browse files
committed
Merge tag 'nfsd-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fix from Chuck Lever: - Fix a use-after-free when unlocking a filesystem * tag 'nfsd-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Prevent post-shutdown use-after-free in NFSD_CMD_UNLOCK_FILESYSTEM
2 parents 0fd8b67 + 92ea163 commit 0f26556

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

fs/nfsd/nfsctl.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,14 +2340,15 @@ int nfsd_nl_unlock_filesystem_doit(struct sk_buff *skb,
23402340
if (error)
23412341
return error;
23422342

2343-
nfsd4_cancel_copy_by_sb(net, path.dentry->d_sb);
23442343
error = nlmsvc_unlock_all_by_sb(path.dentry->d_sb);
23452344

23462345
mutex_lock(&nfsd_mutex);
2347-
if (nn->nfsd_serv)
2346+
if (nn->nfsd_serv) {
2347+
nfsd4_cancel_copy_by_sb(net, path.dentry->d_sb);
23482348
nfsd4_revoke_states(nn, path.dentry->d_sb);
2349-
else
2349+
} else {
23502350
error = -EINVAL;
2351+
}
23512352
mutex_unlock(&nfsd_mutex);
23522353

23532354
path_put(&path);

0 commit comments

Comments
 (0)