Subject: Re: [PATCH] KVM: arm64: Validate the FF-A memory access descriptor placement

From: Marc Zyngier <[email-masked]>
Date: Wed, 22 Apr 2026 13:24:02 +0100

On Wed, 22 Apr 2026 11:25:40 +0100,
Sebastian Ene <[email-masked]> wrote:
> 
> Prevent the pKVM hypervisor from making assumptions that the
> endpoint memory access descriptor (EMAD) comes right after the
> FF-A memory region header and enforce a strict placement for it
> when validating an FF-A memory lend/share transaction.

As I read this, you want to remove a bad assumption...

> 
> Prior to FF-A version 1.1 the header of the memory region
> didn't contain an offset to the endpoint memory access descriptor.
> The layout of a memory transaction looks like this:
> 
>   Field name				| Offset
> 					 -- 0
> [ Header (ffa_mem_region)               |__ ep_mem_offset
>   EMAD 1 (ffa_mem_region_attributes)	|
> ]
> 
> Reject the host from specifying a memory access descriptor offset
> that is different than the size of the memory region header.

And yet you decide that you want to enforce this assumption. I don't
understand how you arrive to this conclusion.

Looking at the spec, it appears that the offset is *designed* to allow
a gap between the header and the EMAD. Refusing to handle a it seems to be a
violation of the spec.

What am I missing?

	M.

-- 
Without deviation from the norm, progress is not possible.