summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Bortoli <tomasbortoli@gmail.com>2018-07-10 00:29:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-09 20:07:55 +0200
commit7bba0ec33b0b17d1b1609f992825f5b162304738 (patch)
tree55260517b47706344a88e13e004078ed24833fd7
parentfd38cf65a88ec9dc2be3ebac91d08cc137bdf8bd (diff)
downloadlinux-stable-7bba0ec33b0b17d1b1609f992825f5b162304738.tar.gz
linux-stable-7bba0ec33b0b17d1b1609f992825f5b162304738.tar.bz2
linux-stable-7bba0ec33b0b17d1b1609f992825f5b162304738.zip
net/9p/client.c: version pointer uninitialized
commit 7913690dcc5e18e235769fd87c34143072f5dbea upstream. The p9_client_version() does not initialize the version pointer. If the call to p9pdu_readf() returns an error and version has not been allocated in p9pdu_readf(), then the program will jump to the "error" label and will try to free the version pointer. If version is not initialized, free() will be called with uninitialized, garbage data and will provoke a crash. Link: http://lkml.kernel.org/r/20180709222943.19503-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com> Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com Reviewed-by: Jun Piao <piaojun@huawei.com> Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com> Cc: Eric Van Hensbergen <ericvh@gmail.com> Cc: Ron Minnich <rminnich@sandia.gov> Cc: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/9p/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index f24b774d2215..7122b32b310f 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -938,7 +938,7 @@ static int p9_client_version(struct p9_client *c)
{
int err = 0;
struct p9_req_t *req;
- char *version;
+ char *version = NULL;
int msize;
p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",