[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4] xen: detect uninitialized xenbus in xenbus_init
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, jgross@xxxxxxxx
- From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
- Date: Thu, 25 Nov 2021 10:20:51 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lAFi+9QQ5wBoZ0S2Yq68JR+rDQ6U57ejFyK9Div3QZU=; b=g6UPfDfb4ew4aW90oihxC7+YiT3sQEbl2EtQevwtno3yv5E/8wkiDEFo7VH4P6kZ5Kgb+TT3bREdJSrUD4nx4WnoHouOMgKzAKL2AOcpU+McRWFcJwMqomuafBAkNO80+jTXDKOKPmdKdwYX2XmKTpFKz+xP8sRAX9TfqLzCZlHYdgEZjR9LeqDogf2Azy72WTB2AyiTdYXwwq6LoTo07rCGjekYU/eAGIEVg+f+VdzpwsGAQWDkicKJDn9I0mdMcFq2IJMSbsaTv7Yykqc1puXDYjPTjOWZQ4X6BqyEsn70KqurpvqBtAlzEUjcy76+BOQZD5IZ96iA/auSEGm34Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/znt3qpWfCkkM+4JxktmV/zhCEPFBeGNJ6voteumoYqo/XbsgO6zQl0q9SP+KAYtNn7ZbP0ZJ9sBmAVYvoNcR/J3OHM1FfHjX9nYPOAICJBJXiBGYo2GLxXGqOkjpYkzyB8kBLmTXiedG0X4LNv88ukRvuJIsauqVppIFpkaGJylBU3aRhI1O+BCA7guSD2OjS7lj4xssVmFD8TgPjYJCuiXbFuX+QeQwUUrgZmBq7Cd7DbTK5ylDP6A77TpCa5CFr77g3Sh9Htrs+qmqEloF5kn7vXZwJvaOLd8HSaRLYQUutOr7vGjFdfKl+T0gpJyDfQoUdre7KkHrZJvYRhkA==
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, jbeulich@xxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx
- Delivery-date: Thu, 25 Nov 2021 15:21:28 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11/23/21 4:07 PM, Stefano Stabellini wrote:
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
If the xenstore page hasn't been allocated properly, reading the value
of the related hvm_param (HVM_PARAM_STORE_PFN) won't actually return
error. Instead, it will succeed and return zero. Instead of attempting
to xen_remap a bad guest physical address, detect this condition and
return early.
Note that although a guest physical address of zero for
HVM_PARAM_STORE_PFN is theoretically possible, it is not a good choice
and zero has never been validly used in that capacity.
Also recognize all bits set as an invalid value.
For 32-bit Linux, any pfn above ULONG_MAX would get truncated. Pfns
above ULONG_MAX should never be passed by the Xen tools to HVM guests
anyway, so check for this condition and return early.
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Applied to for-linus-5.16c
-boris
|