[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] EFI: Fix relocating ESRT for dom0
- To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Wed, 11 Feb 2026 00:58:25 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=eLLcyqarVogVOK/76OmWLICUXJWTpS84dyt6ewkbiBw=; b=shdPgfsFtoupsanpNUFhJXnlwk4Dc9VYhQPBs//M/KzOFKhTitLGKU24aJrJ+s95KpgqVh/fHREp7jfPL6xUur8hqrbQr1YR3x5svbgX1n2EimsMBhMVbKnBI7iyQG4nC4A6HFUUIYw0HvtOimz60nxfGFe2nmGqZbZyUqTjUzfK2JtswzSHJN/osNS2r3Tp9kEI4wQ9SHqyTyD3EkYPfjReHzNCOirp4i713hUZxaVWcCe3mWeuAJbHBslrlV3RenaXiIJ4KRqMsGPjTr2qiL2gOSi20f9R9ZvWNzE/6447ExnC2jREZ3r2lmILvihjkk1CIyskmE1OiHu/LmE7sw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ISoZcR//QdhEifX33laPmPu8aHkpX6q7E8JOyC1dKNt/ViyR1OK+vdlivyQad+m0JjYd97KLg+QhIbwBZeOTGdggV5IXDQ+T5CXQ3brMF9/nqGPDwMUQSzjEsAMHYm1rZfrjm9/YEaBtCVM/tCVLoQjqQNi+t/YZuLCXyWS0aIDiwui0Xh90oXr0X/2RgTy214DDzjoBRpUw0myk7p7sS2SGv2H/038y82xal2y45+SZCBVbks/I6kZcNEJdDsk63YheTwFc5C6HQetY6qSpPmNiZcyOwAaXJTlTnh7WBaiThYbEhrOdbE2wGa71QurMAqHyfIrt94z7T8g+HQuy/w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
- Delivery-date: Wed, 11 Feb 2026 00:58:46 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11/02/2026 12:16 am, Marek Marczykowski-Górecki wrote:
> Fix calculating the table size - it consists of a header + entries, not
> just entries.
> This bug caused the last entry to have garbage in its final fields,
> including LowestSupportedFwVersion and CapsuleFlags, which (usually)
> made fwupd to detect firmware update availability, but refuse actually
"made fwupd able to"
> installing it.
>
> Fixes: dc7da0874ba4 ("EFI: preserve the System Resource Table for dom0")
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> ---
> xen/common/efi/boot.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index 5b84dbf26e5e..45015a0dd583 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -675,7 +675,8 @@ static size_t __init get_esrt_size(const
> EFI_MEMORY_DESCRIPTOR *desc)
> if ( esrt_ptr->FwResourceCount > available_len /
> sizeof(esrt_ptr->Entries[0]) )
> return 0;
>
> - return esrt_ptr->FwResourceCount * sizeof(esrt_ptr->Entries[0]);
> + return offsetof(EFI_SYSTEM_RESOURCE_TABLE, Entries) +
> + esrt_ptr->FwResourceCount * sizeof(esrt_ptr->Entries[0]);
offsetof(EFI_SYSTEM_RESOURCE_TABLE, Entries[esrt_ptr->FwResourceCount])
is a shorter expression with the same answer, and a pattern we use
elsewhere. I can fix on commit if you're happy.
~Andrew
|