Skip to content

Commit cf9182e

Browse files
author
J. Bruce Fields
committed
nfsd4: fix nfs4 stateid leak
Processes that open and close multiple files may end up setting this oo_last_closed_stid without freeing what was previously pointed to. This can result in a major leak, visible for example by watching the nfsd4_stateids line of /proc/slabinfo. Reported-by: Cyril B. <cbay@excellency.fr> Tested-by: Cyril B. <cbay@excellency.fr> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 8a4c6e1 commit cf9182e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/nfsd/nfs4state.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,6 +3766,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
37663766
memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));
37673767

37683768
nfsd4_close_open_stateid(stp);
3769+
release_last_closed_stateid(oo);
37693770
oo->oo_last_closed_stid = stp;
37703771

37713772
if (list_empty(&oo->oo_owner.so_stateids)) {

0 commit comments

Comments
 (0)