NFSD: fix a leak which can cause CREATE_SESSION failures
authorKinglong Mee <kinglongmee@gmail.com>
Mon, 23 Dec 2013 09:31:21 +0000 (17:31 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 3 Jan 2014 23:18:47 +0000 (18:18 -0500)
check_forechannel_attrs gets drc memory, so nfsd must put it when
check_backchannel_attrs fails.

After many requests with bad back channel attrs, nfsd will deny any
client's CREATE_SESSION forever.

A new test case named CSESS29 for pynfs will send in another mail.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 1aed9be56414715c3d4e815d60dbcc0bc6bd2d40..9a6d088247fd6d8d07b1364a7cbcd825c940b115 100644 (file)
@@ -1915,7 +1915,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
                return status;
        status = check_backchannel_attrs(&cr_ses->back_channel);
        if (status)
-               return status;
+               goto out_release_drc_mem;
        status = nfserr_jukebox;
        new = alloc_session(&cr_ses->fore_channel);
        if (!new)