]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.33.2/sunrpc-fix-a-potential-memory-leak-in-auth_gss.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.33.2 / sunrpc-fix-a-potential-memory-leak-in-auth_gss.patch
1 From cdead7cf12896c0e50a8be2e52de52c364603095 Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Fri, 19 Mar 2010 15:36:22 -0400
4 Subject: SUNRPC: Fix a potential memory leak in auth_gss
5
6 From: Trond Myklebust <Trond.Myklebust@netapp.com>
7
8 commit cdead7cf12896c0e50a8be2e52de52c364603095 upstream.
9
10 The function alloc_enc_pages() currently fails to release the pointer
11 rqstp->rq_enc_pages in the error path.
12
13 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17 ---
18 net/sunrpc/auth_gss/auth_gss.c | 5 ++---
19 1 file changed, 2 insertions(+), 3 deletions(-)
20
21 --- a/net/sunrpc/auth_gss/auth_gss.c
22 +++ b/net/sunrpc/auth_gss/auth_gss.c
23 @@ -1273,9 +1273,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp)
24 rqstp->rq_release_snd_buf = priv_release_snd_buf;
25 return 0;
26 out_free:
27 - for (i--; i >= 0; i--) {
28 - __free_page(rqstp->rq_enc_pages[i]);
29 - }
30 + rqstp->rq_enc_pages_num = i;
31 + priv_release_snd_buf(rqstp);
32 out:
33 return -EAGAIN;
34 }