Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp614954imu; Fri, 9 Nov 2018 03:19:05 -0800 (PST) X-Google-Smtp-Source: AJdET5c4IdNX7za3Q9Tzqr7X+rpkKobg90iQ5yYtw9mUOEBWncA1OLBN46iatxA2W4g5KN4qfk1G X-Received: by 2002:a63:3f44:: with SMTP id m65mr7242321pga.115.1541762345637; Fri, 09 Nov 2018 03:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541762345; cv=none; d=google.com; s=arc-20160816; b=Cz1UAQwxouLCw12kOIo0NojCXt7lxrkBgaCXV3S5R0d2U2rr+f+phb64STb2C06GeM tEZRu4rP9IxQpw0NibezXGKhaPFLwbu1bUlY7u0X9TnR7w81X+FhNV7CDmLfVIW7mLqX cFjFFaiexLDlOSa7IEqq6gIB7oeUTuZNt9dR4rJN5suWtJS+TlzCfm4p7ojUktioJq/S c2NOjAewMfwQvWyQRM3nIhHpiFeq+eXgNxO7qAF7e406Yi5ZU3/iezFlFN6E/cTPQBUx cDCXZtgJlupwYDrALaPRoa5Q/tneop4bas3b3I8DT2tU2xPswbqClBASWPhSTiJLSHs2 v6Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=7+7TXjylZCN2Qkn5ycj+weTHoCMBEcUT/nPtjvMkYyE=; b=qWdoaii2vOkIi8zBq+/zMp6GK6vYxTsRQyz9G/PTxq1Urx2/+uShdtIQt1zjhAF4wC xB9bPnB/Jw5tjIZz2LcZ68QbW4HWabx63qfPhQVBtm59qKuuvzypwpQ78viKOC1LwNHa IWmizOQ+TCEW4jHKl2LGmW3mCKtX45fKvbfKD+dw9XJzaFnE6Xa1GIrYDXxYqV1t1z/0 8TegJETunVZU2rs9i/gtVcTiYd//yYkAtxQ5OhyVsq+BPoxEcHYz4qASrVfQZkIKeqzJ N6nEIXp29eOaDp1DS9wquVlhW7Ep+ad2kYxV6zgQMrLwdAWsLVnEFDGJrDu279g0VB3Y wckw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm2 header.b=eV+w5xAq; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=qYwNxKWF; 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 u9-v6si3779222pfh.271.2018.11.09.03.18.49; Fri, 09 Nov 2018 03:19:05 -0800 (PST) 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=@kroah.com header.s=fm2 header.b=eV+w5xAq; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=qYwNxKWF; 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 S1728311AbeKIU5O (ORCPT + 99 others); Fri, 9 Nov 2018 15:57:14 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52737 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727532AbeKIU5O (ORCPT ); Fri, 9 Nov 2018 15:57:14 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5769D23075; Fri, 9 Nov 2018 06:17:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 09 Nov 2018 06:17:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=7+7TXjylZCN2Qkn5ycj+weTHoCM BEcUT/nPtjvMkYyE=; b=eV+w5xAqjHlZ5z0drRVd5vBGsCTzFSq9gvhrr3zTgBZ 0S4A9Obm6C6aAQUtR18KAXgtBY8P6a92iJVhqgQQPU05qW/cwl/AmJwDl+4xGb9M HgRQEPDnVbaB3cI7xIi91J1810C0B/bMDGVhwi6ULW+O330MsDS7sX1hptWkCWYr Sgc+U851Zcdbw/3VOGeTspYj8myDCNQ10vAADJZQEMfsvE/65auIonmGyS0sXK2V mZoJ+Ryh12X+t3Kzaki098bPe92SU+gOyS9CxTHZ8YEipuotSc5rJccQXb88RFGg WyHaDLvKTFLi8aFwtt/nBcToH8oa7Ew2SNOlA6zUcUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7+7TXj ylZCN2Qkn5ycj+weTHoCMBEcUT/nPtjvMkYyE=; b=qYwNxKWFeqaKLHPVV0TOU/ l5UhkZGsMDEQmKuxC0CZXWPKrW4kEtTZuQSeroerHrPxfE58WuR+4g31tIs9bjUQ JorkbuH2DQYnxmrpWaPYfBXO6BzO8aU/JwPf2plWLLAwKL9/97ZcqGZDOVcYTOuS 4iNPQZz5hmhFX4k39vmwM+PzHqM64gzj3ftNDsQ3dEJT6fIydZhX+xtIDMV/Se53 T8axH0VpkVEpZi/4LceXYxLcorZc0EdHH6yXMfQ/5mYNNi7oENY6vdqEVOj7bbd2 J00X/Nf0KK8HYoeDf/YUO+UYaQoTpnT98/Gcsmvdil3lo5LWGWVuPtL2PAY+4sOg == X-ME-Sender: X-ME-Proxy: Received: from localhost (71-6-98-120.static-ip.telepacific.net [71.6.98.120]) by mail.messagingengine.com (Postfix) with ESMTPA id AD8B4102E8; Fri, 9 Nov 2018 06:17:01 -0500 (EST) Date: Fri, 9 Nov 2018 03:17:00 -0800 From: Greg KH To: Manjunath Patil Cc: boris.ostrovsky@oracle.com, jgross@suse.com, konrad.wilk@oracle.com, roger.pau@citrix.com, axboe@kernel.dk, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] xen-blkfront: fix kernel panic with blkfront_remove() Message-ID: <20181109111700.GC26335@kroah.com> References: <1541725108-1468-1-git-send-email-manjunath.b.patil@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1541725108-1468-1-git-send-email-manjunath.b.patil@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 08, 2018 at 04:58:28PM -0800, Manjunath Patil wrote: > If a hot-attaching device fails inside domU[ex:negotiate_mq() returns > with ENOMEM] we clear the blkfront_info struct in talk_to_blkback() > > When we try to detach the device, blkfront_remove() tries to access > blkfront_info leading to kernel panic. > > Typical call stack involving panic - > #10 page_fault at ffffffff816f25df > [exception RIP: blkif_free+46] > #11 blkfront_remove at ffffffffa004de47 [xen_blkfront] > #12 xenbus_dev_remove at ffffffff813faa4c > #13 __device_release_driver at ffffffff814769aa > #14 device_release_driver at ffffffff81476a63 > #15 bus_remove_device at ffffffff814762eb > #16 device_del at ffffffff81472684 > #17 device_unregister at ffffffff814727e2 > #18 xenbus_dev_changed at ffffffff813fa89f > #19 frontend_changed at ffffffff813fca19 > #20 xenwatch_thread at ffffffff813f88f9 > #21 kthread at ffffffff810a486b > #22 ret_from_fork at ffffffff816ed2a8 > > Cc: stable@vger.kernel.org > Signed-off-by: Manjunath Patil > --- > drivers/block/xen-blkfront.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c > index dc8fe25..144cda8 100644 > --- a/drivers/block/xen-blkfront.c > +++ b/drivers/block/xen-blkfront.c > @@ -2496,6 +2496,9 @@ static int blkfront_remove(struct xenbus_device *xbdev) > > dev_dbg(&xbdev->dev, "%s removed", xbdev->nodename); > > + if(!info) > + return 0; > + Always run scripts/checkpatch.pl on your patches so you do not get a grumpy maintainer telling you to run scripts/checkpatch.pl on your patches. thanks, greg k-h