[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>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 24 Nov 2021 08:33:00 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=/gta5DZArVhcL3E/yTesEapUc4qE/6mmL65q1KJqu70=; b=inp+SiGAEqjvD32SCxJsQDh6z1ADOwmeFvcr6aSaP76iJJPI1/hK+tUlu/5uKUCdEpcxV0Uc3EvaGZauStQKScp2IU3/yL7cfe7t3VDXXE5J9+gZF89rm+bF5pMVneVg508vyoyHlTtUndcFgM71dgjDMlzYokZtViqf4A6AF7rlj5tkO3odJXA4KxkEwH92yDFUOtuOi/gaelKxktZ/YLdY/cQY1eoGiRxQ4LfQjK5GqmQ3jWcCCL2m+s0DOPvPC9EIAJe6IRb+3W4eiH0nV9XXJBsYXuk3PbNjsQ/Pw1qJkgx1T2zMHLbj4Hgm4LQHEBiR512Pc862eAEo/F9rgg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e+HOdRowXh8cUc7s1MCcXI+TKCfMpEXVAIfaN2ty60BNS+Vpn/jkHvuONRFhU14KHEOBH+b+5Aru8xo3AW3Q8qJEnXXrCJF52xR6AswObucOumrwa8XC5l3BCfD5cQJo30ommwcXMQwQAP2v8Vrwdvlcpz/V6TwjbwKwjoNgNqm6VG5B/sAHAouwqjX1Y3kVIFcoMJ57O0UEOog7aUniorXXMgV5Q4YK7qAqAmqt7qmdSAuU2+gNSOuCQPjcT+j0H/Szo7KoNGp79ZvgQNJEScgp8Z8z752yyqibBabJZZg++r5yoKMCukA5vmF6/TZOp9sZjo9ExNDLxFfKPDwiRA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: boris.ostrovsky@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx, jgross@xxxxxxxx
- Delivery-date: Wed, 24 Nov 2021 07:33:18 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 23.11.2021 22:07, 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>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
|