3.16.62-rc1 review patch. If anyone has any objections, please let me know.
------------------ From: Tomas Bortoli <tomasbort...@gmail.com> 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-tomasbort...@gmail.com Signed-off-by: Tomas Bortoli <tomasbort...@gmail.com> Reported-by: syzbot+65c6b72f284a39d41...@syzkaller.appspotmail.com Reviewed-by: Jun Piao <piao...@huawei.com> Reviewed-by: Yiwen Jiang <jiangyi...@huawei.com> Cc: Eric Van Hensbergen <eri...@gmail.com> Cc: Ron Minnich <rminn...@sandia.gov> Cc: Latchesar Ionkov <lu...@ionkov.net> Signed-off-by: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Dominique Martinet <dominique.marti...@cea.fr> Signed-off-by: Ben Hutchings <b...@decadent.org.uk> --- net/9p/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/9p/client.c +++ b/net/9p/client.c @@ -938,7 +938,7 @@ static int p9_client_version(struct p9_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",