Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp331574imu; Fri, 7 Dec 2018 01:41:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/V1v3Z258T8/thXw43VC0Hb1MAlQXr0zEPrxhLzi2eQYjVfdMNZScTbBbUmIy81dnu52crh X-Received: by 2002:a17:902:346:: with SMTP id 64mr1478172pld.337.1544175683134; Fri, 07 Dec 2018 01:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544175683; cv=none; d=google.com; s=arc-20160816; b=q+AAMTQdoVxhvliUUJ2g/wlTGOg8Pf5LwGBXoQ4v9UnJQXDhWmvj/Xfihy6+yGRhCX Tk/GqiBdmR1WXL90n0V9qg3mPhmUC9c0UzQamvidYw+8DgZtFftgIEnfOWqilQjYFuQ1 0pJMPYfdT/11i9P/pnMrPzzSht8lvi8Hn7XhfUk8kEQjgMRKq0joh1XCz34U9aj07e2z v3jhmxxT8e8xxHznGj7Y8T1iNYhJDFhTol/QLfcKwQJb/yWmdsdUWAHmSa7AyuSH4moH oDk6WBBpaaAwWOh82i3KzVG/3QLdfW0UOJOp1ETA5JgOmsgIm6hpjhcyuL8w3RU8LVU4 Iqcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=vZkiULkGAYyK2d/9d7NXrPkVuT1D/bNOnkU9TwCyOGo=; b=M9bV9fo5XUcRaBKAvwn6AysFQTw6BQQZmDzbu9q0q8QwVXeqnidDqX6UNHTYZfxnN/ QQP2OrfyCTFN5zXxJQsH6Qq6sJSeg//yMwRxpWCbx48gE6RWrOEOGHRw+3gat3J2E/FK 7VpSDJfi6Et9AnL1fgwH2YkNXPVtc5a7T2xUcLHLsOhQrR2b2kuQqdayVpH85kZ2LgM+ tYp8TOIZJd6bY+lVf/bXUxnk2tB4+/E9lXrfuD/TrpjOR8pWkW1SB0IOk4FPT0B5Jfxp ax14huriCtptZVX4ruAA4BFQ4ZndWtig0+ak1F63NcFrbbysJ3joFLqmT0Nqjgx8uULE hHrA== 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 l124si2672381pfl.284.2018.12.07.01.41.07; Fri, 07 Dec 2018 01:41:23 -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; 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 S1726035AbeLGJjT (ORCPT + 99 others); Fri, 7 Dec 2018 04:39:19 -0500 Received: from smtp.eu.citrix.com ([185.25.65.24]:51591 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbeLGJjT (ORCPT ); Fri, 7 Dec 2018 04:39:19 -0500 X-IronPort-AV: E=Sophos;i="5.56,324,1539648000"; d="scan'208";a="82942895" From: Paul Durrant To: 'Dongli Zhang' , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xenproject.org" , "linux-block@vger.kernel.org" CC: "axboe@kernel.dk" , Roger Pau Monne , "konrad.wilk@oracle.com" Subject: RE: [Xen-devel] [PATCH 1/1] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront Thread-Topic: [Xen-devel] [PATCH 1/1] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront Thread-Index: AQHUjePlVFCFD2KmD0G9djADL/FCxaVzAuIQ Date: Fri, 7 Dec 2018 09:39:15 +0000 Message-ID: <742d0e02a1aa4031ad68a9f81fe2bdc4@AMSPEX02CL03.citrite.net> References: <1544156284-7756-1-git-send-email-dongli.zhang@oracle.com> In-Reply-To: <1544156284-7756-1-git-send-email-dongli.zhang@oracle.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBYZW4tZGV2ZWwgW21haWx0bzp4 ZW4tZGV2ZWwtYm91bmNlc0BsaXN0cy54ZW5wcm9qZWN0Lm9yZ10gT24gQmVoYWxmDQo+IE9mIERv bmdsaSBaaGFuZw0KPiBTZW50OiAwNyBEZWNlbWJlciAyMDE4IDA0OjE4DQo+IFRvOiBsaW51eC1r ZXJuZWxAdmdlci5rZXJuZWwub3JnOyB4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmc7IGxp bnV4LQ0KPiBibG9ja0B2Z2VyLmtlcm5lbC5vcmcNCj4gQ2M6IGF4Ym9lQGtlcm5lbC5kazsgUm9n ZXIgUGF1IE1vbm5lIDxyb2dlci5wYXVAY2l0cml4LmNvbT47DQo+IGtvbnJhZC53aWxrQG9yYWNs ZS5jb20NCj4gU3ViamVjdDogW1hlbi1kZXZlbF0gW1BBVENIIDEvMV0geGVuL2Jsa2JhY2s6IHJl d29yayBjb25uZWN0X3JpbmcoKSB0bw0KPiBhdm9pZCBpbmNvbnNpc3RlbnQgeGVuc3RvcmUgJ3Jp bmctcGFnZS1vcmRlcicgc2V0IGJ5IG1hbGljaW91cyBibGtmcm9udA0KPiANCj4gVGhlIHhlbnN0 b3JlICdyaW5nLXBhZ2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