]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
SUNRPC: Fix a pipe_version reference leak
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 16 Feb 2014 18:28:01 +0000 (13:28 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Mar 2014 17:05:15 +0000 (10:05 -0700)
commit e9776d0f4adee8877145672f6416b06b57f2dc27 upstream.

In gss_alloc_msg(), if the call to gss_encode_v1_msg() fails, we
want to release the reference to the pipe_version that was obtained
earlier in the function.

Fixes: 9d3a2260f0f4b (SUNRPC: Fix buffer overflow checking in...)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/auth_gss/auth_gss.c

index a642fd616d3a3ab050173599304f3ae9680ed4aa..1eebf2251b014c640030076c1dbec493267f645b 100644 (file)
@@ -500,10 +500,12 @@ gss_alloc_msg(struct gss_auth *gss_auth,
        default:
                err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
                if (err)
-                       goto err_free_msg;
+                       goto err_put_pipe_version;
        };
        kref_get(&gss_auth->kref);
        return gss_msg;
+err_put_pipe_version:
+       put_pipe_version(gss_auth->net);
 err_free_msg:
        kfree(gss_msg);
 err: