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/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c

    r105670 r108794  
    17651765  UINT64                                     Value;
    17661766  CHAR8                                      **CharArray;
     1767  UINTN                                      StrLength;
    17671768
    17681769  if ((RedfishPlatformConfigPrivate == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (ConfigureLang) || (StatementValue == NULL)) {
     
    17721773  TempBuffer  = NULL;
    17731774  StringArray = NULL;
     1775  StrLength   = 0;
    17741776
    17751777  Status = ProcessPendingList (&RedfishPlatformConfigPrivate->FormsetList, &RedfishPlatformConfigPrivate->PendingList);
     
    18411843      StatementValue->BufferLen       = TargetStatement->HiiStatement->StorageWidth;
    18421844      StatementValue->BufferValueType = TargetStatement->HiiStatement->Value.BufferValueType;
    1843     } else if ((TargetStatement->HiiStatement->Operand == EFI_IFR_NUMERIC_OP) && (StatementValue->Type == EFI_IFR_TYPE_NUM_SIZE_64)) {
     1845    } else if (TargetStatement->HiiStatement->Operand == EFI_IFR_NUMERIC_OP) {
     1846      if (StatementValue->Type == EFI_IFR_TYPE_NUM_SIZE_64) {
     1847        //
     1848        // Redfish only has numeric value type and it does not care about the value size.
     1849        // Do a patch here so we have proper value size applied.
     1850        //
     1851        StatementValue->Type = TargetStatement->HiiStatement->Value.Type;
     1852      }
     1853
    18441854      //
    1845       // Redfish only has numeric value type and it does not care about the value size.
    1846       // Do a patch here so we have proper value size applied.
     1855      // Check maximum and minimum values when they are set.
    18471856      //
    1848       StatementValue->Type = TargetStatement->HiiStatement->Value.Type;
     1857      if ((TargetStatement->StatementData.NumMaximum > 0) && (TargetStatement->StatementData.NumMaximum >= TargetStatement->StatementData.NumMinimum)) {
     1858        if (StatementValue->Value.u64 > TargetStatement->StatementData.NumMaximum) {
     1859          DEBUG ((DEBUG_ERROR, "%a: integer value: %lu is greater than maximum value: %lu\n", __func__, StatementValue->Value.u64, TargetStatement->StatementData.NumMaximum));
     1860          return EFI_ACCESS_DENIED;
     1861        } else if (StatementValue->Value.u64 < TargetStatement->StatementData.NumMinimum) {
     1862          DEBUG ((DEBUG_ERROR, "%a: integer value: %lu is smaller than minimum value: %lu\n", __func__, StatementValue->Value.u64, TargetStatement->StatementData.NumMinimum));
     1863          return EFI_ACCESS_DENIED;
     1864        }
     1865      }
    18491866    } else {
    18501867      DEBUG ((DEBUG_ERROR, "%a: catch value type mismatch! input type: 0x%x but target value type: 0x%x\n", __func__, StatementValue->Type, TargetStatement->HiiStatement->Value.Type));
     
    18541871
    18551872  if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && (StatementValue->Type == EFI_IFR_TYPE_STRING)) {
     1873    //
     1874    // Check string length when length limitation is set.
     1875    //
     1876    if ((TargetStatement->StatementData.StrMaxSize > 0) && (TargetStatement->StatementData.StrMaxSize >= TargetStatement->StatementData.StrMinSize)) {
     1877      StrLength = StrLen ((EFI_STRING)StatementValue->Buffer);
     1878      if (StrLength > TargetStatement->StatementData.StrMaxSize) {
     1879        DEBUG ((DEBUG_ERROR, "%a: string length: %u is greater than maximum string length: %u\n", __func__, StrLength, TargetStatement->StatementData.StrMaxSize));
     1880        return EFI_ACCESS_DENIED;
     1881      } else if (StrLength < TargetStatement->StatementData.StrMinSize) {
     1882        DEBUG ((DEBUG_ERROR, "%a: string length: %u is smaller than minimum string length: %u\n", __func__, StrLength, TargetStatement->StatementData.StrMinSize));
     1883        return EFI_ACCESS_DENIED;
     1884      }
     1885    }
     1886
    18561887    //
    18571888    // Create string ID for new string.
     
    24842515                  );
    24852516  if (EFI_ERROR (Status)) {
    2486     DEBUG ((DEBUG_ERROR, "%a: locate EFI_HII_STRING_PROTOCOL failure: %r\n", __func__, Status));
     2517    DEBUG ((DEBUG_INFO, "%a: locate EFI_HII_STRING_PROTOCOL failure: %r\n", __func__, Status));
    24872518    return;
    24882519  }
     
    25192550                  );
    25202551  if (EFI_ERROR (Status)) {
    2521     DEBUG ((DEBUG_ERROR, "%a: locate EFI_HII_DATABASE_PROTOCOL failure: %r\n", __func__, Status));
     2552    DEBUG ((DEBUG_INFO, "%a: locate EFI_HII_DATABASE_PROTOCOL failure: %r\n", __func__, Status));
    25222553    return;
    25232554  }
     
    25822613                  );
    25832614  if (EFI_ERROR (Status)) {
    2584     DEBUG ((DEBUG_ERROR, "%a: locate EFI_REGULAR_EXPRESSION_PROTOCOL failure: %r\n", __func__, Status));
     2615    DEBUG ((DEBUG_INFO, "%a: locate EFI_REGULAR_EXPRESSION_PROTOCOL failure: %r\n", __func__, Status));
    25852616    return;
    25862617  }
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