]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.137/9p-net-fix-memory-leak-in-p9_client_create.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.137 / 9p-net-fix-memory-leak-in-p9_client_create.patch
CommitLineData
77a1b479
GKH
1From bb06c388fa20ae24cfe80c52488de718a7e3a53f Mon Sep 17 00:00:00 2001
2From: zhengbin <zhengbin13@huawei.com>
3Date: Wed, 13 Mar 2019 16:01:37 +0800
4Subject: 9p/net: fix memory leak in p9_client_create
5
6From: zhengbin <zhengbin13@huawei.com>
7
8commit bb06c388fa20ae24cfe80c52488de718a7e3a53f upstream.
9
10If msize is less than 4096, we should close and put trans, destroy
11tagpool, not just free client. This patch fixes that.
12
13Link: http://lkml.kernel.org/m/1552464097-142659-1-git-send-email-zhengbin13@huawei.com
14Cc: stable@vger.kernel.org
15Fixes: 574d356b7a02 ("9p/net: put a lower bound on msize")
16Reported-by: Hulk Robot <hulkci@huawei.com>
17Signed-off-by: zhengbin <zhengbin13@huawei.com>
18Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 net/9p/client.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25--- a/net/9p/client.c
26+++ b/net/9p/client.c
27@@ -1065,7 +1065,7 @@ struct p9_client *p9_client_create(const
28 p9_debug(P9_DEBUG_ERROR,
29 "Please specify a msize of at least 4k\n");
30 err = -EINVAL;
31- goto free_client;
32+ goto close_trans;
33 }
34
35 err = p9_client_version(clnt);