Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp272505ybe; Thu, 5 Sep 2019 22:13:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXA1C4y3f5u17OTgByh1s0Kmd9PIEhCOq0+dHmYsl4FP4eSvpDxp6paEkphV65TGcsR26v X-Received: by 2002:a17:90a:303:: with SMTP id 3mr7772736pje.124.1567746783940; Thu, 05 Sep 2019 22:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567746783; cv=none; d=google.com; s=arc-20160816; b=HbUMAw+28TmqHOOjtLM12O3FHgM3SpGZoP/afrgiqqwdobbBVbjSa29pydNF/IcCe7 wXyvFBNj5UZh104FH85ym1YiMbEW/YqbmPmhLLvgQRJt/vUzpL5mNVFMj7T0Fs1jXiXA bIB73Gy/FUdhc6M02izpmadOksaulzIQE5C1mNXjBmXH3WB6w8CKovurhvg1IuSQ7LfG 3HC0Mgw5i/I34VtNfaQzjJTJDUS2WgXxnCBbAaxt70xj9DVJVrl8wIP0W0+sdKguMJAJ YF7lNwRJQCpWkr5WUgUbFT4jm598y87dXz9QabVmRazxtzDFP0FxixSVituahR2zm4Yo DsUQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lRUinMedpGnaJcSq4sObs+q5SPzFk/SnAoZ99OMDEL4=; b=bZl6VzQhEmKXFeWJBNUxvebAYgKPbURTrF1FCNFQ4dZepq4icFJFzdSIp53kpNL1Yo Zxcgc9oaNRcSwEktiyIOiHii7UGjsP5+pnhsbwBRQTsLjKGHyDSZh5vipO/946GCjhdb eLZ5DmwkcI0Q7Ura6CvdfO4wZgGLmDqxX6QxkWDnn4nXlf6ox5Ndx60zqBKhqDSq4ewU 77ibX56vsb9HdfZN3YCFTP1eKg+7eKki3RdPsTxy8ZG8YrkOXhfsZjGS//WT2a1KHL8x B2YKJJK/1+LBZKO5ZMGuMpW6E30TDB23Vm7Oj5vWuc3h0ZUYc+QZc9eM4EzR1dRtf9c0 QNdA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o71si3991258pjo.53.2019.09.05.22.12.47; Thu, 05 Sep 2019 22:13:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391484AbfIETuT (ORCPT + 99 others); Thu, 5 Sep 2019 15:50:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40038 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388106AbfIETt1 (ORCPT ); Thu, 5 Sep 2019 15:49:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8FA9307D851; Thu, 5 Sep 2019 19:49:26 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id C33BA5D6A3; Thu, 5 Sep 2019 19:49:26 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 160592253A5; Thu, 5 Sep 2019 15:49:18 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, miklos@szeredi.hu Cc: linux-kernel@vger.kernel.org, virtio-fs@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com Subject: [PATCH 13/18] virtiofs: Do not access virtqueue in request submission path Date: Thu, 5 Sep 2019 15:48:54 -0400 Message-Id: <20190905194859.16219-14-vgoyal@redhat.com> In-Reply-To: <20190905194859.16219-1-vgoyal@redhat.com> References: <20190905194859.16219-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 05 Sep 2019 19:49:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In request submission path it is possible that virtqueue is already gone due to driver->remove(). So do not access it in dev_dbg(). Use pr_debug() instead. If virtuqueue is gone, this will result in NULL pointer deference. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 40259368a6bd..01bbf2c0e144 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -888,10 +888,10 @@ __releases(fiq->waitq.lock) fs = fiq->priv; fc = fs->vqs[queue_id].fud->fc; - dev_dbg(&fs->vqs[queue_id].vq->vdev->dev, - "%s: opcode %u unique %#llx nodeid %#llx in.len %u out.len %u\n", - __func__, req->in.h.opcode, req->in.h.unique, req->in.h.nodeid, - req->in.h.len, fuse_len_args(req->out.numargs, req->out.args)); + pr_debug("%s: opcode %u unique %#llx nodeid %#llx in.len %u out.len %u" + "\n", __func__, req->in.h.opcode, req->in.h.unique, + req->in.h.nodeid, req->in.h.len, + fuse_len_args(req->out.numargs, req->out.args)); fpq = &fs->vqs[queue_id].fud->pq; spin_lock(&fpq->lock); -- 2.20.1