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

Re: [PATCH v2 2/4] xen/arm: guest_walk: refuse an address outside both halves of the range


  • To: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 18 Nov 2026 02:10:42 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nZmQtJLHjLRC4iQvxf8oPa9XiafR3PE7KfPqSvoKcb4=; b=U2Ei98Z3gdHXzYkDoCH0M1urcgSvD0PWm2s/tnwaCgtcd20OXs8Mo9hWtbEazLoE2lOnLR8q8FWhmcJlYyY/g8kDFrDxgDVhkP2y8kY5rvfEOsG4GSt1HQh0Mf4ykvcQUROntke6p/EL4ft8whUn0W2PUnzYqmSnNPh2qZP8bgRMZnpM2QC5owjrwMfms+1xJPRLnMad0+XXlIjuMW5zrDDEs3w3QpT4exUorPZCCY9kGe1RypM6LKlU5AZBLPM5M46bpQoaJbTGUIGFAa5tpdqY+WOicCn50YQDa79pbWu6lbvduG3VKpodTeqLnxmeAnKp1aRhaYBLQzZh1pG/vg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gZ4P4p/lTK8elefhBkCQ1ULDukGnu4Twv9dVbd82G+Q8b7fieX/pSKW9/B4cPepR9/HsV3xiZSZiYVqz8joy6bELYaTpLhI/+z30G9ewLVQk+Zu6wW5xTDFaMX8NFgCTVVtAhJ5t2s3PJjWuuEprlTpnncxaxTxl8r+R16SP99a+sjDINpm7EJo4BVCXy1Foturn7UG8mp11oEi9HBvXR9HokzLbSiv4y2D/04DgbhtRhQHr/tOyV2iHP9ASo7Iqr46zLDYAWmV6mRY1/rnW1Q3+p3rmXh6KNqWm2T2yPQIlyHJOkDzyMxY8Nb3G2T9CAfDRW+Qq2toMpoyE/5SqFg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 18 Nov 2026 02:10:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHddvgLLKv7Oha5C0G7B7gsa06XibczFhYA
  • Thread-topic: [PATCH v2 2/4] xen/arm: guest_walk: refuse an address outside both halves of the range

Hi,

Stefano Stabellini <stefano.stabellini@xxxxxxx> writes:

> The bits of an input address from its top bit (bit 63, or bit 55 with
> the top byte ignored) down to the input address size must be all 0 for
> TTBR0 and all 1 for TTBR1, else the walk faults (ARM DDI 0487 M.d
> D8.2.4, AArch64.VAIsOutOfRange()). guest_walk_ld() chose the base from
> the top bit alone and translated such an address. Refuse it before
> reading any table.
>
> Fixes: 7d623b358a45 ("arm/mem_access: Add long-descriptor based gpt")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

> ---
> Cc: Julien Grall <julien@xxxxxxx>
> Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> Cc: Michal Orzel <michal.orzel@xxxxxxx>
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
>
> Changes in v2:
> - Cite ARM DDI 0487 M.d (D8.2.4, AArch64.VAIsOutOfRange()) instead of
>   A.k, in the commit message and the comment.
> - Move the Cc list after ---.
> ---
>  xen/arch/arm/guest_walk.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c
> index 151b837541..8c73ceb04d 100644
> --- a/xen/arch/arm/guest_walk.c
> +++ b/xen/arch/arm/guest_walk.c
> @@ -408,6 +408,15 @@ static bool guest_walk_ld(const struct vcpu *v,
>          if ( (input_size > TCR_EL1_IPS_48_BIT_VAL) ||
>               (input_size < TCR_EL1_IPS_MIN_VAL) )
>              return false;
> +
> +        /*
> +         * The bits of the GVA from the top bit down to the input size must
> +         * all be 0 for TTBR0 and all 1 for TTBR1, or the translation faults
> +         * (ARM DDI 0487 M.d D8.2.4, AArch64.VAIsOutOfRange()).
> +         */
> +        mask = GENMASK_ULL(topbit, input_size);
> +        if ( (gva & mask) != ((gva & BIT(topbit, ULL)) ? mask : 0) )
> +            return false;
>      }
>      else
>      {

-- 
WBR, Volodymyr


 


Rackspace

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