From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Julien Grall <julien@xen.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2 2/4] xen/arm: guest_walk: refuse an address outside both halves of the range
Date: Wed, 18 Nov 2026 02:10:42 +0000 [thread overview]
Message-ID: <87mrr6nb31.fsf@epam.com> (raw)
In-Reply-To: <9ec26a7839aa586343f6c566e07dde208f781a3f.1794962603.git.stefano.stabellini@amd.com>
Hi,
Stefano Stabellini <stefano.stabellini@amd.com> 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@amd.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
> Cc: Julien Grall <julien@xen.org>
> Cc: Bertrand Marquis <bertrand.marquis@arm.com>
> Cc: Michal Orzel <michal.orzel@amd.com>
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
>
> 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
next prev parent reply other threads:[~2026-11-18 2:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1794962603.git.stefano.stabellini@amd.com>
2026-11-18 0:59 ` [PATCH v2 1/4] xen/arm: guest_walk: refuse a block descriptor where the granule has none Stefano Stabellini
2026-11-18 2:04 ` Volodymyr Babchuk
2026-11-18 0:59 ` [PATCH v2 2/4] xen/arm: guest_walk: refuse an address outside both halves of the range Stefano Stabellini
2026-11-18 2:10 ` Volodymyr Babchuk [this message]
2026-11-18 0:59 ` [PATCH v2 3/4] xen/arm: traps: enter the SP_EL0 vector group for an exception at EL1t Stefano Stabellini
2026-11-18 0:59 ` [PATCH v2 4/4] vpci/header: empty the BAR range sets when modify_bars() fails Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mrr6nb31.fsf@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=stefano.stabellini@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.