Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp659266imm; Fri, 27 Jul 2018 03:59:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcgjKxzBIHDyv3/xvbxMjehBamqfRPwyHsV/HIw1mTm5E/mKvVbbo3CPWefdZgH3V4iCN4w X-Received: by 2002:a17:902:7247:: with SMTP id c7-v6mr5632831pll.79.1532689188514; Fri, 27 Jul 2018 03:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532689188; cv=none; d=google.com; s=arc-20160816; b=oRyOxigvOAZHDy+JcvI9Es1RUFUA1Op4Lc+U+F3dLs/uICwBBWmn4yMiWjORNxgsmu bWAovi0UCeKo2NwsBDaOC8a9X4xBsMgNERPMid2xILfceGV8V2IEKYFrIaTb+gOMNYca micn+C19icWCbFH13DGucz9Cd9CqT4CQjVS9lut8suAPb8PMDTHKaWDrKHRiGuaHqeos riw90O80Q+Eu/KYfID7zR355++Fkvydk4pNYR+mEz7K/lTwy4SD59WDGe4Ed2p11JnKJ WDk14/DRrb9aUk43X1wunsV3FGaXrpeWEgC2yUFmqH4i6CJjc0GXwLeSsVC2PWxCl/3j Qxjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=miwov9+Mwsa7aVMUUgLch5d0RK92x8U5X1VHNrENTcQ=; b=azFBgks5GqB0uBT+mN1e142dxzfDS5mZnF5ntU3r8blEbLB40OAjDsfZPdxnDlrq36 Xhlu4zCorVeoArd9knjKWIxeby61oHVfvmQXz0dSFY6RbWPH+lgIKArjuePciMNozy58 XFGCXUY2rVXK6QXPNvSIrcsD0/hmfy4WP6R42zTmR2qbYitCo1Kg8LeMKJiKP5AoNwWk Fo9eRKw1BOuHW5Qh1k7AbBddawTQDrQAzK6YFLHEqN81+84U0/iRsLP/1BtoRcYd5NfK f/nhTib+EEhuhnRBBhtYzxeAmPmeidbVrhVSqa1fOkOlIJzpQE9/Xv/l8J8tA4WdJQT9 TulA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I8BJE2ga; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21-v6si3746176pgb.553.2018.07.27.03.59.33; Fri, 27 Jul 2018 03:59:48 -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=@google.com header.s=20161025 header.b=I8BJE2ga; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732108AbeG0MSe (ORCPT + 99 others); Fri, 27 Jul 2018 08:18:34 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44464 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729539AbeG0MSe (ORCPT ); Fri, 27 Jul 2018 08:18:34 -0400 Received: by mail-pf1-f193.google.com with SMTP id k21-v6so1617098pff.11 for ; Fri, 27 Jul 2018 03:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=miwov9+Mwsa7aVMUUgLch5d0RK92x8U5X1VHNrENTcQ=; b=I8BJE2gacaJH6CgXVOWJ8pYAun9JOzJV8Nd0tU2D4u9J7XB6KuQMDC8nE5wuHqPziB EDk8yvWnyZxvpvl9ApM0Lgkddxv5AKFyrDUPp7eh3sJbR+emoX2cJbCV6JS08IfmYK+y 4acflQdePTQDdt0xHMntAf4NJ2L541/wdnQgZFUWKrlGuliBVMqxEDdowsB/FbnF6xt4 pEItlmvHrAQJil7Zdnaeh8Tj3Km1cb6NWFzNvUei9OBNAuz50xDnrqWsEr/4BplJPwrz lxTArLckFkF9CKKyZVb6zU4Hr78jamNZPTshIM9oqD3mefufAtecrrF2AFUN8O1E4ZAG xNHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=miwov9+Mwsa7aVMUUgLch5d0RK92x8U5X1VHNrENTcQ=; b=FVdxUNsAofb0XvlI7xfj1Hf1qiDNVoQ1tJmuEWtUnMwBGRCl1BHgqPPo6IXebDTuNI Hv7bgHRpewPJOMYB9SSsj1j+PMH729qVYSDt66IwLfQDg5+v/SLy7/HsjCIZyQe/yWGy oxIyOLcvH9t+Axf6CRNJsmXMNLQ2kISxlsogTGvQ15HOfxrQ6ryZ58aPw/izFAboyACP Nd9SnkfilipZoOfI8K3vG5bwr14Oev7TxF52VcWzOaY5/750vImmdHiwD34KTphRiF2j u1zECjarOaaBDwWpcyVMwNk3V9T3wY8JKQ+EaJsZeBZt3+gIP64m6kiy5uo2lyC/IKyE Fqpg== X-Gm-Message-State: AOUpUlHiOoO1vPp85K2jm75vV1b5RyEsEeAmg+IM+tXa1CopT6SfG0e3 naTnK2BiMucASWC7f3HvAPdb2LfSwjN3mUZ3FFEMMA== X-Received: by 2002:a63:743:: with SMTP id 64-v6mr5830013pgh.216.1532689030042; Fri, 27 Jul 2018 03:57:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:ac14:0:0:0:0 with HTTP; Fri, 27 Jul 2018 03:56:49 -0700 (PDT) In-Reply-To: <20180727101915.4191-1-tomasbortoli@gmail.com> References: <20180727101915.4191-1-tomasbortoli@gmail.com> From: Dmitry Vyukov Date: Fri, 27 Jul 2018 12:56:49 +0200 Message-ID: Subject: Re: [PATCH] 9p: fix multiple NULL-pointer-dereferences To: Tomas Bortoli Cc: Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Dominique Martinet , David Miller , v9fs-developer@lists.sourceforge.net, netdev , LKML , syzkaller 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 On Fri, Jul 27, 2018 at 12:19 PM, Tomas Bortoli wrote: > Added checks to prevent GPFs from raising. This supersedes the previous patch, right? If so please add: Reported-by: syzbot+1a262da37d3bead15c39@syzkaller.appspotmail.com so that the bug will be auto-closed. > Signed-off-by: Tomas Bortoli > --- > net/9p/trans_fd.c | 5 ++++- > net/9p/trans_rdma.c | 3 +++ > net/9p/trans_virtio.c | 3 +++ > net/9p/trans_xen.c | 3 +++ > 4 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c > index 964260265b13..e2ef3c782c53 100644 > --- a/net/9p/trans_fd.c > +++ b/net/9p/trans_fd.c > @@ -945,7 +945,7 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) > if (err < 0) > return err; > > - if (valid_ipaddr4(addr) < 0) > + if (addr == NULL || valid_ipaddr4(addr) < 0) > return -EINVAL; > > csocket = NULL; > @@ -995,6 +995,9 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args) > > csocket = NULL; > > + if (addr == NULL) > + return -EINVAL; > + > if (strlen(addr) >= UNIX_PATH_MAX) { > pr_err("%s (%d): address too long: %s\n", > __func__, task_pid_nr(current), addr); > diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c > index 2649b2ebf961..2ab4574183c9 100644 > --- a/net/9p/trans_rdma.c > +++ b/net/9p/trans_rdma.c > @@ -645,6 +645,9 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args) > struct rdma_conn_param conn_param; > struct ib_qp_init_attr qp_attr; > > + if (addr == NULL) > + return -EINVAL; > + > /* Parse the transport specific mount options */ > err = parse_opts(args, &opts); > if (err < 0) > diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c > index 06dcd3cc6a29..8ca356eb66bb 100644 > --- a/net/9p/trans_virtio.c > +++ b/net/9p/trans_virtio.c > @@ -654,6 +654,9 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args) > int ret = -ENOENT; > int found = 0; > > + if (devname == NULL) > + return -EINVAL; > + > mutex_lock(&virtio_9p_lock); > list_for_each_entry(chan, &virtio_chan_list, chan_list) { > if (!strncmp(devname, chan->tag, chan->tag_len) && > diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c > index 2e2b8bca54f3..c2d54ac76bfd 100644 > --- a/net/9p/trans_xen.c > +++ b/net/9p/trans_xen.c > @@ -94,6 +94,9 @@ static int p9_xen_create(struct p9_client *client, const char *addr, char *args) > { > struct xen_9pfs_front_priv *priv; > > + if (addr == NULL) > + return -EINVAL; > + > read_lock(&xen_9pfs_lock); > list_for_each_entry(priv, &xen_9pfs_devs, list) { > if (!strcmp(priv->tag, addr)) { > -- > 2.11.0 > > -- > You received this message because you are subscribed to the Google Groups "syzkaller" group. > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.