Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp511083imu; Fri, 4 Jan 2019 01:58:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgdrWm6ZsLb46j9Gor73uZDhe8dKuGLeGVkRd/De2KiINBcZQ7WPW5NHE8Qeq/170Nwrkp X-Received: by 2002:a62:36c1:: with SMTP id d184mr51943767pfa.242.1546595920669; Fri, 04 Jan 2019 01:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546595920; cv=none; d=google.com; s=arc-20160816; b=mgGe/PJ+Nz/w5QW3KV1J6CNUoQXdYPprHrah6mCQGcoDAd3j37T+5IEEy4Y1egWLrw tPCoMNmxb7d+f0R8k95r0IDQY788BPnzFWmj+Y8nB9u48SacS9WXvqA9bxvjdYuygtN5 iLqEFInhuWex25z7XMt0tIBI+Ad0Y6iBE5KcD4e3sDNnlnsbcSRu1nvmpS7ooQpwmQZ+ +qPnXgAe/w9GPNZ/esBIt+Wn18W0RMX6yqfqVU4zsxHXOBGQ6pBRNFkEHeXSS23/9rr3 /NYgEIEtn0mfT1rwdZN3+dXaa0aFqJ1Y3lMDx4oIGNuNDiMod4G/Gsfn9O1QHeqiaNI9 JskQ== 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=fcAg7eYUsYNmtBLlijsRInhrroqrXecRwb/HT2p56DI=; b=K5zpddo+TKxaq/EeOTnC7uzl1VT0vOss87lPcSJMjYWKVapYAYpz5wfa5LH8yuslcy CwJtIfL0pbOLRasvQnKQbYqpcnIByZipqTrSLEqEXFm2743kzU38kUFdJWdMdayEnQr1 yTc6BlOyVfgtu4kV+BHgZCUpDDR3vZRU2ZhJnECW/tGDiWp1FrbbObnJqqds1EykoiyI u1Z5exywQz6Af3OV1d3bX84c/jrxtsGUp3CIeF6NZUtHWuMxRJHdsk2eSX1W2IWoiyfM BHLC63Ttnx33Io3WUUrKMeCWoQlWi2042v4Me4d4tgknriQ/YZZM8FPamFbz7enLOOxA QucA== 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 186si36483204pgi.424.2019.01.04.01.58.25; Fri, 04 Jan 2019 01:58:40 -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 S1727315AbfADIyt (ORCPT + 99 others); Fri, 4 Jan 2019 03:54:49 -0500 Received: from smtp.ctxuk.citrix.com ([185.25.65.24]:58352 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727291AbfADIys (ORCPT ); Fri, 4 Jan 2019 03:54:48 -0500 X-IronPort-AV: E=Sophos;i="5.56,437,1539648000"; d="scan'208";a="84132450" From: Paul Durrant To: 'Dongli Zhang' , "xen-devel@lists.xenproject.org" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "konrad.wilk@oracle.com" , Roger Pau Monne , "axboe@kernel.dk" Subject: RE: [PATCH v3 1/1] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront Thread-Topic: [PATCH v3 1/1] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront Thread-Index: AQHUo8zawIy3TZpueECGz8zbAfARkKWeymfQ Date: Fri, 4 Jan 2019 08:54:44 +0000 Message-ID: References: <1545225782-31403-1-git-send-email-dongli.zhang@oracle.com> <620a62e3-204d-b5f2-e76f-7277492c2fb7@oracle.com> In-Reply-To: <620a62e3-204d-b5f2-e76f-7277492c2fb7@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 PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBPbiAxMi8xOS8yMDE4IDA5OjIzIFBNLCBE b25nbGkgWmhhbmcgd3JvdGU6DQo+ID4gVGhlIHhlbnN0b3JlICdyaW5nLXBhZ2Utb3JkZXInIGlz IHVzZWQgZ2xvYmFsbHkgZm9yIGVhY2ggYmxrYmFjayBxdWV1ZQ0KPiBhbmQNCj4gPiB0aGVyZWZv cmUgc2hvdWxkIGJlIHJlYWQgZnJvbSB4ZW5zdG9yZSBvbmx5IG9uY2UuIEhvd2V2ZXIsIGl0IGlz DQo+IG9idGFpbmVkDQo+ID4gaW4gcmVhZF9wZXJfcmluZ19yZWZzKCkgd2hpY2ggbWlnaHQgYmUg Y2FsbGVkIG11bHRpcGxlIHRpbWVzIGR1cmluZyB0aGUNCj4gPiBpbml0aWFsaXphdGlvbiBvZiBl YWNoIGJsa2JhY2sgcXVldWUuDQo+ID4NCj4gPiBJZiB0aGUgYmxrZnJvbnQgaXMgbWFsaWNpb3Vz IGFuZCB0aGUgJ3JpbmctcGFnZS1vcmRlcicgaXMgc2V0IGluDQo+IGRpZmZlcmVudA0KPiA+IHZh bHVlIGJ5IGJsa2Zyb250IGV2ZXJ5IHRpbWUgYmVmb3JlIGJsa2JhY2sgcmVhZHMgaXQsIHRoaXMg bWF5IGVuZCB1cCBhdA0KPiA+IHRoZSAiV0FSTl9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