Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2329994imm; Tue, 10 Jul 2018 18:28:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdH4HgSd6or1uwDnw1uroh21zGebcDncsxNfJfeBvjMDqkiVbzTmHVJS5TTckAtcStvNliH X-Received: by 2002:a65:60cd:: with SMTP id r13-v6mr24922434pgv.232.1531272537308; Tue, 10 Jul 2018 18:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531272537; cv=none; d=google.com; s=arc-20160816; b=f4wlhkuybn6hyi79NP/gGVjK/zZj5h8ZwhKzx5DkJUy+2kG7i3r2WXaML506oG3+Nt 5AqHwXeaGNPcxBXtqXGyp7UGPeNJRcCCowOltrHfySbML4dehx+SHhqZ6xZ/l+eaAgtq T4P42agxZD0gtvBUg3ND5TjZYjXGtbh/rX6Wy7bt/y14fCKmhag8tnVwqZ4ol+vPR6c9 yDe8xhw//YcJ783Ga9EHn7D2MgZWckRqn1Y+y3eD4HTaQBNZiWkh8AzpjuUDlyiZ6kZg W/jTLm7wPdLBtvFAFpidMH5n3WdZ9VY3tnnIV+8hqzS5Qw51OOX7r/EMKbu4XeSW6txP jcNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=G3AOoFGdBIEmhfIxlNKT8+N0lUZAlemhYR3qa2sE1VY=; b=kxHM0AL4ZhwxHbUtg6yeRodrN1OaJM0N0rYAfvPcDJnxlULodWDf/rjt8BfJ4PSMW4 K1vFATApbrOzb0k6aZDMA98mxPnCLwEPciYODA5ITwBv8BnMomoe649rXB1j23TdMH0E QG97XvZBFVnNrpWFl0JT62tbEf4DFsfcLqipBtvZnTDDygra1/EbKOl+WcqP5vg6zRtw PluKG5B6ZvohrKsau6dWF3AuTOZeWbxbWPRHPvNZ7HPGT8k1QMpIzrBgDz5GZ71N1185 Ujk67/K1EWCvmgZJsg49FbjUU968x3UM2+iQg3hpZui/5jqP7/20Wj9DBuqQdIatAa3D N+XA== 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 x33-v6si18064944plb.512.2018.07.10.18.28.41; Tue, 10 Jul 2018 18:28:57 -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 S1732433AbeGKB2X (ORCPT + 99 others); Tue, 10 Jul 2018 21:28:23 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:56861 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732304AbeGKB2X (ORCPT ); Tue, 10 Jul 2018 21:28:23 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D327C8F7A99CE; Wed, 11 Jul 2018 09:26:33 +0800 (CST) Received: from [127.0.0.1] (10.177.16.168) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.382.0; Wed, 11 Jul 2018 09:26:20 +0800 Subject: Re: [V9fs-developer] [PATCH] version pointer uninitialized To: Tomas Bortoli , , , References: <20180709222943.19503-1-tomasbortoli@gmail.com> CC: , , , , From: jiangyiwen Message-ID: <5B455CBB.8030501@huawei.com> Date: Wed, 11 Jul 2018 09:26:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20180709222943.19503-1-tomasbortoli@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.16.168] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/10 6:29, Tomas Bortoli wrote: > 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. > > Signed-off-by: Tomas Bortoli Reviewed-by: Yiwen Jiang > Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com > --- > net/9p/client.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/9p/client.c b/net/9p/client.c > index 18c5271910dc..40f7c47f2f74 100644 > --- a/net/9p/client.c > +++ b/net/9p/client.c > @@ -957,7 +957,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", >