Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf9182e9 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

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: default avatarCyril B. <cbay@excellency.fr>
Tested-by: default avatarCyril B. <cbay@excellency.fr>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 8a4c6e19
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3766,6 +3766,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
	memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));

	nfsd4_close_open_stateid(stp);
	release_last_closed_stateid(oo);
	oo->oo_last_closed_stid = stp;

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