From 524a0906c7ccffab690786fc1764b1877b6063f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Andrade?= <95101505+viniciusdsandrade@users.noreply.github.com> Date: Thu, 19 Nov 2026 21:23:16 -0300 Subject: [PATCH] fix(uefi): recognize the PI firmware file system 3 GUID (#12602) * fix(uefi): recognize the PI firmware file system 3 GUID FFS3_FILE_SYSTEM_GUID held 54731207-5c41-4cbd-b5e5-cd26d80770b1, which is not a published file-system GUID. The PI Specification and EDK II define EFI_FIRMWARE_FILE_SYSTEM3_GUID as 5473c07a-3dcb-4dca-bd6f-1e9689e7349a, so a real FFS3 volume was classified as an unsupported file system: its files were not walked and flash admission did not count it. Use the published value. The opaque-volume acceptance case built its walked volume from the same literal and now declares the published GUID. * test(uefi): pin the FFS3 GUID to its published raw bytes Every FFS3 fixture was built from FFS3_FILE_SYSTEM_GUID itself, so the tests followed whatever value the constant held. Check the constant against the sixteen bytes EDK II defines for EFI_FIRMWARE_FILE_SYSTEM3_GUID, as the FFS2 case does for its GUID. --- src/uefi/UefiGuid.test.ts | 11 +++++++++++ src/uefi/UefiGuid.ts | 4 ++-- tests/acceptance/uefiFirmware.test.ts | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/uefi/UefiGuid.test.ts b/src/uefi/UefiGuid.test.ts index 15fb0310e8..e9b077247a 100644 --- a/src/uefi/UefiGuid.test.ts +++ b/src/uefi/UefiGuid.test.ts @@ -2,6 +2,7 @@ import { Buffer } from "node:buffer"; import { expect, it } from "vitest"; import { FFS2_FILE_SYSTEM_GUID, + FFS3_FILE_SYSTEM_GUID, formatGuidLittleEndian, guidEquals, } from "./UefiGuid.js"; @@ -11,6 +12,12 @@ const ffs2RawBytes = Buffer.from([ 0xc3, 0x2d, 0xd3, ]); +// EFI_FIRMWARE_FILE_SYSTEM3_GUID as EDK II stores it in a volume header. +const ffs3RawBytes = Buffer.from([ + 0x7a, 0xc0, 0x73, 0x54, 0xcb, 0x3d, 0xca, 0x4d, 0xbd, 0x6f, 0x1e, 0x96, 0x89, + 0xe7, 0x34, 0x9a, +]); + const lzmaCustomRawBytes = Buffer.from([ 0x98, 0x58, 0x4e, 0xee, 0x14, 0x39, 0x59, 0x42, 0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf, @@ -29,6 +36,10 @@ it("formats the FFS2 container GUID from raw little-endian bytes", () => { ); }); +it("names the published FFS3 container GUID for its raw bytes", () => { + expect(formatGuidLittleEndian(ffs3RawBytes, 0)).toBe(FFS3_FILE_SYSTEM_GUID); +}); + it("formats the LZMA custom compression GUID", () => { expect(formatGuidLittleEndian(lzmaCustomRawBytes, 0)).toBe( "ee4e5898-3914-4259-9d6e-dc7bd79403cf", diff --git a/src/uefi/UefiGuid.ts b/src/uefi/UefiGuid.ts index 507dffa9f4..cc8666010b 100644 --- a/src/uefi/UefiGuid.ts +++ b/src/uefi/UefiGuid.ts @@ -47,6 +47,6 @@ export const FFS2_FILE_SYSTEM_GUID = "8c8ce578-8a3d-4f1c-9935-896185c32dd3"; /** * FFS3 container GUID (PI Specification, firmware file system 3). - * Raw bytes: 07 12 73 54 41 5C BD 4C B5 E5 CD 26 D8 07 70 B1. + * Raw bytes: 7A C0 73 54 CB 3D CA 4D BD 6F 1E 96 89 E7 34 9A. */ -export const FFS3_FILE_SYSTEM_GUID = "54731207-5c41-4cbd-b5e5-cd26d80770b1"; +export const FFS3_FILE_SYSTEM_GUID = "5473c07a-3dcb-4dca-bd6f-1e9689e7349a"; diff --git a/tests/acceptance/uefiFirmware.test.ts b/tests/acceptance/uefiFirmware.test.ts index 5ae4cc5077..9f55498893 100644 --- a/tests/acceptance/uefiFirmware.test.ts +++ b/tests/acceptance/uefiFirmware.test.ts @@ -340,7 +340,7 @@ it("retains an opaque volume and reports only the unparsed ranges in the selecte const path = join(root, "mixed.fd"); const nvDataGuid = "fff12b8d-7696-4c8b-a985-2747075b4f50"; const valid = buildFv({ - fileSystemGuid: "54731207-5c41-4cbd-b5e5-cd26d80770b1", + fileSystemGuid: "5473c07a-3dcb-4dca-bd6f-1e9689e7349a", files: [ buildFfsFile({ guid: DRIVER_GUID, typeCode: 0x07, payload: PE_SECTION }), ],