Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1022825imm; Mon, 9 Jul 2018 15:32:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGNat+wp0smpH5Q4ge12FFICE/xt2aaXnNFwSRps5gtNSmP0ttw8rKfBAuY02TXIBLLT5J X-Received: by 2002:a17:902:a989:: with SMTP id bh9-v6mr22647979plb.245.1531175543220; Mon, 09 Jul 2018 15:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531175543; cv=none; d=google.com; s=arc-20160816; b=YmPLa6m+CBsFt9EczThCEZI2xMiiPttDNB5VE2ypPTEIyEY4tr9LgcaRoEE5xQtFDM 5hJl0TEu9ydk2z2OOf8nzQP6kQ2coAFj/EvvnnHat9eSqTWDNCrkd6VPi8PRfOrCrvGa wEVwXw3N7Kg/z8O6paVUK44mMjB/QUZdd3nlBbA/gO+kQ6T2Z5pfU690l8eMY06vzyFu xwNPB5cxE9sHam14wGS+PWaHY3+zR80PbQQOwxaMj0hUeNWhwURuaXt3TTbXmTl1OaA5 I94cCGn5zsgIR3GW8DeKFD5mzeM5hYx60LvDErHWTatD4MycipsVBtI+tRg3OxqA+29z 0Eqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=V1tIzA5s9ZBQjG86PfvAc0FOgEnotiBT+EEwpCJjPAo=; b=YttgRom8ba5k7rLdBqR/cg+TJGKHxRtbmRrj6TjlVxusYz9iiGOSj3q6DUyxW2ri6t qhpK59llKDP3YnWIdHrlmt+OjD89/d/0eeWj9qDLQ2kmc1MuwDwRAbnTTKp/s1V4a3kQ VDEEfqtf3yaepSi3UwXscxTljCDDm4GVZAio36NuZOCsyLPGOafbWdGeNsXU4LQC5lc+ DvRi0nk/h3HgChBbZSwQ5OKTvrUO2wrLMPsFcDyqAank96nv+x19cGLoZhQ/vjbxkDD0 JaSKRnEb0QsR7bAI2CWL3HgdvpulLtqHBw17lKbZDvajelbLL1xtlqtLmQVTBQnd0j0+ JpFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NJwJLPPL; 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 7-v6si14654398pgf.687.2018.07.09.15.32.07; Mon, 09 Jul 2018 15:32:23 -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=NJwJLPPL; 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 S1754582AbeGIWaD (ORCPT + 99 others); Mon, 9 Jul 2018 18:30:03 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40276 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbeGIWaC (ORCPT ); Mon, 9 Jul 2018 18:30:02 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so22289583wma.5; Mon, 09 Jul 2018 15:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=V1tIzA5s9ZBQjG86PfvAc0FOgEnotiBT+EEwpCJjPAo=; b=NJwJLPPLxl1z4uBJhO7TA/MYd/KkQSBuCN2aACrtdnTVhQoLiZTsbnqsd835uAAomW //lYyLCey6D6VPM7hpjStNTdWLvuaPEclzmHoYAyaRC8fUrOZKs0ZRNsrT7tL4Oj3uGJ GfUqVtTx0Zdnh7860EZHJML1XYYCr0VDX3ACjGrxC8jMZCAbWOfbaWmbl+zypUyZWhwX cvVy8Caq/dukvs0T2Vfy4UB1EvK3RM9bhso9qEx7wElmowdTegaP2oxdpGgyNramSxSe qIgotkPWggXkYj/q5pWbM+ktl0HjUPW+ysSIZQ0VqVDAeg+sTikQGviGqKqmZQda4Lc8 zCpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=V1tIzA5s9ZBQjG86PfvAc0FOgEnotiBT+EEwpCJjPAo=; b=uAHsn7axlDBCZILmhx6nbXX+z4woMyMsgUK+Sjxz63fVLTy0l0W7DAu5Rk7u1uiwjS Y76p4fvvw6hMgFQiO3fAWbyKAIcaycsz4LOP/BXtODaysKlPMgzGPaR/68kl1isNFWh4 MokDi0uIWBOgy+0436bjD1dkbEIBQRpsfYwAlYWFECGyZb0iQG3Bamt2rNdpwTKb0Mza UBT4T7ocGky5BXEErz83NQ9EqSqnTwbVV1fe5kUvxtX/5bb3p+fseJvVA/h7eu7cXkrQ K+B7Y2EP57gpjCiCodPLWU0taJ5IJFlzjmzCsytJ9Mh53Gbl7cQC8cYlvh1eEoWtzhE0 iNjA== X-Gm-Message-State: APt69E1ogrLmsOYtuznHwVLW5v0PgkCbutmpIkKVVzOVag07MHdQJGd0 X4CL6oGJAZxZT5f9LB8IsBA= X-Received: by 2002:a1c:ec86:: with SMTP id h6-v6mr9587749wmi.53.1531175400723; Mon, 09 Jul 2018 15:30:00 -0700 (PDT) Received: from localhost.localdomain ([185.175.214.210]) by smtp.gmail.com with ESMTPSA id s16-v6sm13197865wrq.20.2018.07.09.15.29.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 15:29:59 -0700 (PDT) From: Tomas Bortoli To: ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net Cc: davem@davemloft.net, v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller@googlegroups.com, Tomas Bortoli Subject: [V9fs-developer] [PATCH] version pointer uninitialized Date: Tue, 10 Jul 2018 00:29:43 +0200 Message-Id: <20180709222943.19503-1-tomasbortoli@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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", -- 2.11.0