Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2332574imm; Fri, 7 Sep 2018 14:50:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZLH8EnZSQubVHAa0VcH5Q/Gyus2MeZNpMKzHpwpQeuuCWuNNfldhMNieCatFGiqSxms2lN X-Received: by 2002:a62:e008:: with SMTP id f8-v6mr10804145pfh.208.1536357021281; Fri, 07 Sep 2018 14:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536357021; cv=none; d=google.com; s=arc-20160816; b=sEYIYSBStWMSscUdWF/XKz42eDN1M2/k4dEFpay1NxCceF5majaAo0qUeU7PQ+Y3co ivUrxr+esZPZrbOeuuIk+W9lSCUIr6Ywi46k7+DQ/X8fRzwFchWXYzH2cFJTaPV9U3Re PEUPUavpBX6d6OYbqzzdvC2qCJP2oIYqGHvwTcUKup8gw+DpVTxY41pgTbUygudon2Ln eRPsvs1bHOZK/6cG3kfcatM/dnD8Xy6H1RS3KsPjJsKJJ4GGGJ6MycIK3Mxjm0zB2IOS igfOsuaT7PMUAeGLIhS64ZC9h0eNGrhertXK75CdMB/dPAzBksF3rESLvR86j+EorZle l66w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from; bh=1eW8y0iACgkaOPm5Sjz6VwwD0RWuDW+iMAuReWK6QsA=; b=ga63I8NKQBcP+FhJpUx5ctc6YXeskaMFSGOLIWHPgpsR5RNf4uXPXqPIGWVfOuyZja UEDvGASdu6Ml29QuIMnDyehAHmNEN55xE3uFnRL/mC7Gt6OyDFCfE7iU+J4+5flMtQM3 FJDl8vQNazp0V6X2Ejhehko3J76kuCVOU+jM9Gweyt0sTJZqLfYdo97WRz/OmyNoyhCd /MS6p9/GNFXAfJQ2Zaqjmqsa2DYo3SCKezo5HTq0WQFOptgb2LDX2SWYgz+CVd4KQjmX YNUkfQGy+3gqkC0Oy430zeGxnY7/dMnAqMclYR35q7DoWw5hZ2P3F9DgInrXnclXSqY/ pqUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12-v6si9316013pgg.118.2018.09.07.14.50.05; Fri, 07 Sep 2018 14:50:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbeIHC2I (ORCPT + 99 others); Fri, 7 Sep 2018 22:28:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58040 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730645AbeIHC2H (ORCPT ); Fri, 7 Sep 2018 22:28:07 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B3B631007; Fri, 7 Sep 2018 21:45:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomas Bortoli , syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com, Jun Piao , Yiwen Jiang , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Andrew Morton , Dominique Martinet Subject: [PATCH 3.18 05/29] net/9p/client.c: version pointer uninitialized Date: Fri, 7 Sep 2018 23:10:26 +0200 Message-Id: <20180907210909.968012351@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210909.523240901@linuxfoundation.org> References: <20180907210909.523240901@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomas Bortoli 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 Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com Reviewed-by: Jun Piao Reviewed-by: Yiwen Jiang Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman --- 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",