Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1909943imm; Thu, 12 Jul 2018 09:46:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdg/6qhnORp9vPe7GxIRQ2tPG9nyTOL+i50rlzka8vwsctjqu1a1Z8eaRDYG+gA/VMoUhGo X-Received: by 2002:a65:4b87:: with SMTP id t7-v6mr2732948pgq.391.1531413971531; Thu, 12 Jul 2018 09:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531413971; cv=none; d=google.com; s=arc-20160816; b=wKLHACHHROk5l9N6Fbx7rFbh5dT/zkXj3hCVeREaPU08UzZg9dKzy7lKFp9D1u0Ko6 Dc3xln1wVE8aGnEbKy9Zz5kIlvlQePYQpEvxtUxWK2WWC+Rj8WieBrmLcJ7adOSOa8ED hgmyz3v2C47+EvgLwMSh5Jh55YSsaxCyWB241twbQUsn69O955zan5WWe8gHIZPTT7vl yChYz1FTuDp9kkUMZ7I+TdMCXzFXHJ7DhnF7DJQuzb2mnRKkQvX3h7MWsn7F2zHOjNt+ DlwtwmJD5KI1Dx/H2tK092yAFzWBEzqEKFOFCiqHk3/ABQP+YLBIXjEq7cWz9z0QVwpy j3jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=cJMGzfnu3TyRDgiglceqEEIzN1R+cLijOaQMwQhdM3s=; b=1LZGr9pcdYSI+6omn2W72oOn64G7kvry7bx3jVfJabwABWCv7/FkRijyCSiQEPRhNc YQ7oAJtyxt0LMPlJn8+od8T6SWQLQQarqfZ1f1TCXoFsbdixN66vcsCesBYN/qQLF4bL vYtrCVV9To5kdYNPbwFTOW7yfwxZ5dwOVIRUdHpDSrUbsW5IgWPiA18Am3i5U1SKdf98 /JgEZ4nRTsc7nEptwqCW9sfsoXkgvU0uWJrEbiFQuwjITbVYnSpD92qFCbnFxgohhOsF D8JKJJABvnla20BoJgpBhjyzgb2NNhn+yRwOR8+uFM9R6nB6TFHFRwgJzE5CEoshu6Ym /B9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RGxkF9Jq; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d39-v6si22089980pla.41.2018.07.12.09.45.56; Thu, 12 Jul 2018 09:46:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RGxkF9Jq; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732368AbeGLQym (ORCPT + 99 others); Thu, 12 Jul 2018 12:54:42 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38222 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbeGLQym (ORCPT ); Thu, 12 Jul 2018 12:54:42 -0400 Received: by mail-lj1-f196.google.com with SMTP id p6-v6so22502425ljc.5; Thu, 12 Jul 2018 09:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cJMGzfnu3TyRDgiglceqEEIzN1R+cLijOaQMwQhdM3s=; b=RGxkF9JqD4MRU1KFsApAVtoK1rtPav1UJutQL12ybxXACU4wuUyWh+C8eRQVqAgdss PVPlhLXW2QdPn6hrU9fsYAIrOPQZ1l9eGU7vcrZ2eVxWIlmM1FKF59vcC46G0C1ylxUt 6b8YLmuP4dTnFvEUN54a9fi+OXAurdHkXpdq8ue7YyLQnw8mGPXQpkU22xqhjT+JyLTy VM9wQXT213erxxHURub4kqeEJIz2gtU1p/9aNrdg1dkVvmL3IeOsiH9+rGSH1PNCfps5 IAosAiJJCnUEuCSEl0Auw+k6MNHrGF+rjmAg0T2tHKR12jo0/ZYPTM5jU1JSTkkxm6iP Pr1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=cJMGzfnu3TyRDgiglceqEEIzN1R+cLijOaQMwQhdM3s=; b=PIERFQfOqCkgOrXu0cwZdggW8Lzgo5yCfq7Y7TkuOT4dJRapSMo9Vt/KkNTHfFml0k GryGomDkFd/U3qjn42EntSl6h5Bg3TqZeK3KEFYvCBLjk9j2KZ4MdO9yO+pIIv8AouCT Hkr+AvPQiNFgY2+CINq2uLJ4TbO4kzXsL+RuRx2INc5HQxLcR+I776+CU0gRvwH6IZJ/ 3zR4OU+QE1a6BZ6/A4WygEzltBhfvb823nrc4axn0UPM26PJRA4nSEzx3MGCBHncP4a0 g6vH7n+2fRoa6YsLxqDAJIld63KsRfNPhzDaIRdGBxhflgv9f9GcGAVC5AP4yBs9NbTL /fqQ== X-Gm-Message-State: AOUpUlEo6lDdYbnM2pF6WhosNJhnkbwoUfRfsVx3N5mtXxF4pfCulrDA k+5vuUndcj6I+4uAis0GUHM= X-Received: by 2002:a2e:5d1c:: with SMTP id r28-v6mr1043940ljb.89.1531413859902; Thu, 12 Jul 2018 09:44:19 -0700 (PDT) Received: from ?IPv6:2001:2012:22e:1b00:f2e2:9015:9262:3fde? ([2001:2012:22e:1b00:f2e2:9015:9262:3fde]) by smtp.gmail.com with ESMTPSA id w8-v6sm3283257lfe.67.2018.07.12.09.44.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 09:44:18 -0700 (PDT) Subject: Re: [V9fs-developer] [PATCH] version pointer uninitialized To: jiangyiwen , ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller@googlegroups.com, v9fs-developer@lists.sourceforge.net, davem@davemloft.net, Andrew Morton References: <20180709222943.19503-1-tomasbortoli@gmail.com> <5B455CBB.8030501@huawei.com> From: Tomas Bortoli Openpgp: preference=signencrypt Autocrypt: addr=tomasbortoli@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFpCTZMBEADNZ1+Ibh0Z4pgGRcd1aOUMbe/YfHktmajjcoTnKmZZunjoUVAl8waeLITd BC2c8i1wHzHcnthrmb1izs5XlG6PZnl8n5tjysSNbwggzS1NcEK1qgn5VjNlHQ5aRMUwCC51 kicBiNmlQk2UuzzWwdheRGnaf+O1MNhC0GBeEDKQAL5obOU92pzflv6wWNACr+lHxdnpyies mOnRMjH16NjuTkrGbEmJe+MKp0qbjvR3R/dmFC1wczniRMQmV5w3MZ/N9wRappE+Atc1fOM+ wP7AWNuPvrKg4bN5uqKZLDFH7OFpxvjgVdWM40n0cQfqElWY9as+228Sltdd1XyHtUWRF2VW O1l5L0kX0+7+B5k/fpLhXqD3Z7DK7wRXpXmY59pofk7aFdcN97ZK+r6R7mqrwX4W9IpsPhkT kUyg3/Dx/khBZlJKFoUP325/hoH684bSiPEBroel9alB7gTq2ueoFwy6R3q5CMUw3D+CZWHA 3xllu46TRQ/Vt2g0cIHQNPoye2OWYFJ6kSEvaLpymjNDJ9ph2EuHegon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Yzp7Rx0O1QOnQsXTHqk7K38AdSdM2li/I/zegeblInnLi08Gq6mT6RkD6wV9HE5U3 EIU0rDPyJo54MW39wGjfC2+PM5I0xebbxtnuTewRchVVfm7UWgLAy11pV3xM4wMSJOuqVMOz jYpWKYxDTpvsZ0ginUUY993Gb8k/CxjABEMUGVHhQPZ0OzjHIKS6cTzN6ue8bB+CGOLCaQp1 C0NRT5Tn9zpLxtf5nBExFd/zVENY5vAV2ZbKQdemO54O7j6B9DSgVRrm83GCZxbL4d+qTYBF 3tSCWw/6SG1F3q9gR9QrSC2YRjCmhijUVEh6FhZwB58TNZ1sEEttrps8TDa5tUd9 Message-ID: <02d636a1-858a-45a5-d28c-9f7380d27ab3@gmail.com> Date: Thu, 12 Jul 2018 18:44:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <5B455CBB.8030501@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2018 03:26 AM, jiangyiwen wrote: > 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", >> > + Cc: Andrew Morton This goes with the other patch: [V9fs-developer] [PATCH] p9_parse_header() validate PDU length Tomas