VirtualBox

Ignore:
Timestamp:
Mar 31, 2025 11:31:09 AM (2 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168237
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c

    r101291 r108794  
    7878  Verify blob from an external source.
    7979
     80  If a non-secure configuration is detected this function will enter a
     81  dead loop to prevent a boot.
     82
    8083  @param[in] BlobName           The name of the blob
    8184  @param[in] Buf                The data of the blob
    8285  @param[in] BufSize            The size of the blob in bytes
    83 
    84   @retval EFI_SUCCESS           The blob was verified successfully.
    85   @retval EFI_ACCESS_DENIED     The blob could not be verified, and therefore
    86                                 should be considered non-secure.
     86  @param[in] FetchStatus        The status of the previous blob fetch
     87
     88  @retval EFI_SUCCESS           The blob was verified successfully or was not
     89                                found in the hash table.
     90  @retval EFI_ACCESS_DENIED     Kernel hashes not supported, but the boot
     91                                can continue safely.
    8792**/
    8893EFI_STATUS
     
    9196  IN  CONST CHAR16  *BlobName,
    9297  IN  CONST VOID    *Buf,
    93   IN  UINT32        BufSize
     98  IN  UINT32        BufSize,
     99  IN  EFI_STATUS    FetchStatus
    94100  )
    95101{
     
    98104  HASH_TABLE  *Entry;
    99105
     106  // Enter a dead loop if the fetching of this blob
     107  // failed. This prevents a malicious host from
     108  // circumventing the following checks.
     109  if (EFI_ERROR (FetchStatus)) {
     110    DEBUG ((
     111      DEBUG_ERROR,
     112      "%a: Fetching blob failed.\n",
     113      __func__
     114      ));
     115
     116    CpuDeadLoop ();
     117  }
     118
    100119  if ((mHashesTable == NULL) || (mHashesTableSize == 0)) {
    101120    DEBUG ((
    102       DEBUG_ERROR,
     121      DEBUG_WARN,
    103122      "%a: Verifier called but no hashes table discoverd in MEMFD\n",
    104123      __func__
     
    115134      BlobName
    116135      ));
    117     return EFI_ACCESS_DENIED;
     136
     137    CpuDeadLoop ();
    118138  }
    119139
     
    140160    if (EntrySize != SHA256_DIGEST_SIZE) {
    141161      DEBUG ((
    142         DEBUG_ERROR,
     162        DEBUG_WARN,
    143163        "%a: Hash has the wrong size %d != %d\n",
    144164        __func__,
     
    171191        BlobName
    172192        ));
     193
     194      CpuDeadLoop ();
    173195    }
    174196
     
    176198  }
    177199
     200  //
     201  // If the GUID is not in the hash table, execution can still continue.
     202  // This blob will not be measured, but at least one blob must be.
     203  //
    178204  DEBUG ((
    179205    DEBUG_ERROR,
     
    182208    Guid
    183209    ));
    184   return EFI_ACCESS_DENIED;
     210  return EFI_SUCCESS;
    185211}
    186212
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette