Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2328607imm; Fri, 7 Sep 2018 14:45:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaUgiiwbff51gsabOLHJ9vElWTuolR8hb4R1khMza0mwmopxwWUcTVX5fmd1fQmXSuNq0yi X-Received: by 2002:a62:5047:: with SMTP id e68-v6mr10582978pfb.157.1536356742331; Fri, 07 Sep 2018 14:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356742; cv=none; d=google.com; s=arc-20160816; b=Ws49Ap6wUT9SEA1x0r9JYHxtJ2oIrudwsHQaFKIQMsG7iqb/9Ly0A+QqecFGk/ZyQ2 79D67fIRdfMZhQGoVAS1DGirBVoOJzooTLyGn/7JfCCE43CHTxtYGi23/UGJfs3BjjK+ /UkL9AI7LbMgR9EsAGbkE7mxy5sU4A6/vIfMMgTyZDOmEjgIcrreIO4UtLAKU+a8N50w a8NbaB/yQcufnBkbO7Kmb7vAbhjj4hYXGWX9E2/9ga2gwi+IZ+ynQ1/VTs92luv8c2oP d5psa/W4NGdevlX59S5CQ/7F6vC6YPmoCZc+oOTAhnZqdjFIeDFL+jI1cMmG/RWjCsse e0Ig== 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=T8YL3xVueQ6+ceTsMqDd1dmqZdnxSgzCn8lbFW36qsc=; b=q7Cv9FE2swIkpZJpEukGsTqFMlbf7NOnBAd5aomGGOGcKDg7r70ZYPq4+zEg7d2FYh K6uwPNsnjouK7BX6sBMzsMqqxtuau0jD8AteQ6E0e3kq+S01QOXgytStBPYyZE3x1SJ1 E75xGlhPDafJSs1UCKaQiwFngTZXDOYdsjd1efb1Kbtgp8b0/lHdjcGQaMj5IMhBwsYY 9TQojTJ310yNXQCx/ZE1L0+QCprzorfJLu5/dnxwWBMNTZoCVQaSj7euvoc/GWJbLXSs GD2c1EgHj2bOcRcNe6N55dEKZQQeTlqvHD+BXa/yXSSDVmqJ5IUsvdmd9QP8YxpnLhD8 RRlg== 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 a61-v6si9449220plc.80.2018.09.07.14.45.26; Fri, 07 Sep 2018 14:45:42 -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 S1730028AbeIHC0w (ORCPT + 99 others); Fri, 7 Sep 2018 22:26:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56860 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728272AbeIHC0E (ORCPT ); Fri, 7 Sep 2018 22:26:04 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6A2B5BBF; Fri, 7 Sep 2018 21:43:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomas Bortoli , syzbot+1a262da37d3bead15c39@syzkaller.appspotmail.com, Dominique Martinet Subject: [PATCH 3.18 14/29] 9p: fix multiple NULL-pointer-dereferences Date: Fri, 7 Sep 2018 23:10:35 +0200 Message-Id: <20180907210910.576246097@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 10aa14527f458e9867cf3d2cc6b8cb0f6704448b upstream. Added checks to prevent GPFs from raising. Link: http://lkml.kernel.org/r/20180727110558.5479-1-tomasbortoli@gmail.com Signed-off-by: Tomas Bortoli Reported-by: syzbot+1a262da37d3bead15c39@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman --- net/9p/trans_fd.c | 5 ++++- net/9p/trans_rdma.c | 3 +++ net/9p/trans_virtio.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -934,7 +934,7 @@ p9_fd_create_tcp(struct p9_client *clien if (err < 0) return err; - if (valid_ipaddr4(addr) < 0) + if (addr == NULL || valid_ipaddr4(addr) < 0) return -EINVAL; csocket = NULL; @@ -982,6 +982,9 @@ p9_fd_create_unix(struct p9_client *clie 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); --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -623,6 +623,9 @@ rdma_create_trans(struct p9_client *clie struct ib_qp_init_attr qp_attr; struct ib_device_attr devattr; + if (addr == NULL) + return -EINVAL; + /* Parse the transport specific mount options */ err = parse_opts(args, &opts); if (err < 0) --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -617,6 +617,9 @@ p9_virtio_create(struct p9_client *clien 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) &&