Skip to content

Commit 1116e0e

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: fix potential UAF in nfsd4_cb_getattr_release
Once we drop the delegation reference, the fields embedded in it are no longer safe to access. Do that last. Fixes: c596772 ("NFSD: handle GETATTR conflict with write delegation") Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent da05ba2 commit 1116e0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3078,9 +3078,9 @@ nfsd4_cb_getattr_release(struct nfsd4_callback *cb)
30783078
struct nfs4_delegation *dp =
30793079
container_of(ncf, struct nfs4_delegation, dl_cb_fattr);
30803080

3081-
nfs4_put_stid(&dp->dl_stid);
30823081
clear_bit(CB_GETATTR_BUSY, &ncf->ncf_cb_flags);
30833082
wake_up_bit(&ncf->ncf_cb_flags, CB_GETATTR_BUSY);
3083+
nfs4_put_stid(&dp->dl_stid);
30843084
}
30853085

30863086
static const struct nfsd4_callback_ops nfsd4_cb_recall_any_ops = {

0 commit comments

Comments
 (0)