[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen: detect uninitialized xenbus in xenbus_init


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, jgross@xxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Fri, 19 Nov 2021 17:32:15 -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=0mGO6sDq46Dad6LWRdq9afD/taMjgZUxDP273TaC1q4=; b=Q92SYGfkk5J319fEUKrK2f2CYDRINNIyJ5M7YROmKEk7ktSLIqqjB1AopzPpecLI41kXsfYbUdH20DBaottbEUd4yxSp8SAQ2W6SZc74mZi95VAL8uO78JiWAkU49m4VXH6c0ZsVRIMtQ12EQUt099rzdtJvO+mNoNzNzmrcGftTEp4M6vqPp9mFrsMvuK9RGK++Ch6Z3teQ6MFb95oZbyVo8+hwkRHs/oKUGCEHJj0osC1y22xEc0w7ZlKRt8Hjp0p4vSMSKmx74sfGy8Z03xj+1/HqqgGzPiFgUteq4LL97miK/HWr8ChyN1eDyUwjkIgSDB51riV+5uBBl/FXXA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b960uU9c/B5BgAV8IXJFxmIMxx9URzYsKEBp1p85qL+2E9hXln4N6E737jrPpPHYG59R8Prxk+9HKrZXr+R+9ezn05gZxjMXyybROcsvQ12SjKCF/TRKT+ciuP36ZBc1YyYNpZny4wmlZicfv3gEWVr6KW484izBv3dMdxnWlUX39r7PkAli40Qyt6UTgwesnRT01REz3J8EYuskxWM1ml4SI1OOZsehpW1F/vpz5HOzJU33cEbHR2uK2vKb76DaRZy3egB79yMTIjfQlGvgLVbE+n7TSay9V/YCB2FW6qgD5P7m+BBCguZ6OLEQ5ZMX8+BtrKjK6zD4TYa2KKon+w==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, jbeulich@xxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx
  • Delivery-date: Fri, 19 Nov 2021 22:32:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 11/19/21 3:29 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 the invalid value of INVALID_PFN which is ULLONG_MAX.

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>


Reviewed-by: Boris Ostrovsky <boris.ostrvsky@xxxxxxxxxx>





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.