Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3963017imm; Mon, 15 Oct 2018 07:04:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60fCIkHplcUa0U7IcJiAoCFyQZ0fDR4Q33RymTzFuGHUz5qYk6IZVwx0b72rdaehDPNwFdJ X-Received: by 2002:a17:902:ac89:: with SMTP id h9-v6mr16849554plr.174.1539612252114; Mon, 15 Oct 2018 07:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539612252; cv=none; d=google.com; s=arc-20160816; b=er1o93kLbXTNvLPfr4tbsF6hzV/MJXFq8C74Gx7x1ER1FJUxHkjx2Wn2+PJeE+Gzor obD7lrOSbps64QgSx7XhO1lEzmeD2wsaErpES2O3MVaYh0STrP2EwjAsHqa0wzUgCrlV zVLR2QyFpMwPKhCm/WdAifhWfFdckOCXDeFVfil1RvQZJoPXJzlOhg8HkH6be6gGisOw CviD9JPNuRpWAVUkNdActtGx0iLXjLO1nUaWa5dZaggRi3vcfIY5Tx6r+uqbAvreRkex sfCtc/q6UkyFlTzTw370XtfeujKc9pgu2xOLf0MvdPhLKXt/zOYntjCfAlQrdN3vGAT2 V7/g== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cLsDnrEV3tVHbfgw+meMGQRt6jHE0Li62w53eeWb6NI=; b=pCDkrNVqZEfJSzbbvWIBaiDnaGZeeZ8zsii/axhsm2XQ0dDBzoc5vmeeSqWrFrm8+v JFQ5eAUroMQQG5JDQHoJD9chIQGiKtJXI//UV0FUxAwyrzt3ya2sYtyUliDsIeO+O8NE cAse6Yx8SyqJHuWUToQ5zPorsQ5aYGbtUFXlbqa+YUerdISGyKGs4MSWRDHDvhlj2a9o Cy6MjgL23aTzLxtwwyiNMqlFU9vMj9bODbhxPZ/T/ak5+sMvPTp4DFEqnNknxZHWfJ+9 BMiQ5mv+sEYvdz0ZYt1FNCJL2+pnyZaHmUs3YPVmHZNzM7VqnujGVuv48I5UC4D+Xh1D nTKg== 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 129-v6si10802089pgj.283.2018.10.15.07.03.56; Mon, 15 Oct 2018 07:04:12 -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 S1726727AbeJOVsg (ORCPT + 99 others); Mon, 15 Oct 2018 17:48:36 -0400 Received: from smtp.ctxuk.citrix.com ([185.25.65.24]:6549 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbeJOVsg (ORCPT ); Mon, 15 Oct 2018 17:48:36 -0400 X-IronPort-AV: E=Sophos;i="5.54,384,1534809600"; d="scan'208";a="80446795" Date: Mon, 15 Oct 2018 16:02:01 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Vasilis Liaskovitis CC: , , , , , , Subject: Re: [PATCH v2] xen/blkfront: avoid NULL blkfront_info dereference on device removal Message-ID: <20181015140201.elir7ettk7sz4aix@mac.bytemobile.com> References: <20181015132508.23293-1-vliaskovitis@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181015132508.23293-1-vliaskovitis@suse.com> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 15, 2018 at 03:25:08PM +0200, Vasilis Liaskovitis wrote: > If a block device is hot-added when we are out of grants, > gnttab_grant_foreign_access fails with -ENOSPC (log message "28 > granting access to ring page") in this code path: > > talk_to_blkback -> > setup_blkring -> > xenbus_grant_ring -> > gnttab_grant_foreign_access > > and the failing path in talk_to_blkback sets the driver_data to NULL: > > destroy_blkring: > blkif_free(info, 0); > > mutex_lock(&blkfront_mutex); > free_info(info); > mutex_unlock(&blkfront_mutex); > > dev_set_drvdata(&dev->dev, NULL); > > This results in a NULL pointer BUG when blkfront_remove and blkif_free > try to access the failing device's NULL struct blkfront_info. > > Signed-off-by: Vasilis Liaskovitis Reviewed-by: Roger Pau Monn? Thanks. I guess this is a candidate for backporting?