VirtualBox

Changeset 77259 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Feb 11, 2019 1:27:05 PM (6 years ago)
Author:
vboxsync
Message:

DevPcBios: Avoid suspect _DMI_ header table checksum calculation by using FwCommonPlantSmbiosAndDmiHdrs() instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r76553 r77259  
    15821582        return rc;
    15831583
    1584     for (unsigned i = 0; i < pThis->cbPcBios; i += 16)
    1585     {
    1586         /* If the DMI table is located at the expected place, patch the DMI table length and the checksum. */
     1584    /* Look for _SM_/_DMI_ anchor strings within the BIOS and replace the table headers. */
     1585    for (unsigned i = 0; i < (pThis->cbPcBios - 16); i += 16)
     1586    {
    15871587        if (   pThis->pu8PcBios[i + 0x00] == '_'
    1588             && pThis->pu8PcBios[i + 0x01] == 'D'
     1588            && pThis->pu8PcBios[i + 0x01] == 'S'
    15891589            && pThis->pu8PcBios[i + 0x02] == 'M'
    1590             && pThis->pu8PcBios[i + 0x03] == 'I'
    1591             && pThis->pu8PcBios[i + 0x04] == '_'
    1592             && *(uint16_t*)&pThis->pu8PcBios[i + 0x06] == 0)
    1593         {
    1594             *(uint16_t*)&pThis->pu8PcBios[i + 0x06] = RT_H2LE_U16(cbDmiTables);
    1595             *(uint16_t*)&pThis->pu8PcBios[i + 0x0C] = RT_H2LE_U16(cNumDmiTables);
    1596             uint8_t u8Sum = 0;
    1597             for (unsigned j = 0; j < pThis->cbPcBios; j++)
    1598                 if (j != i + 0x05)
    1599                     u8Sum += pThis->pu8PcBios[j];
    1600             pThis->pu8PcBios[i + 0x05] = -u8Sum;
     1590            && pThis->pu8PcBios[i + 0x03] == '_'
     1591            && pThis->pu8PcBios[i + 0x10] == '_'
     1592            && pThis->pu8PcBios[i + 0x11] == 'D'
     1593            && pThis->pu8PcBios[i + 0x12] == 'M'
     1594            && pThis->pu8PcBios[i + 0x13] == 'I'
     1595            && pThis->pu8PcBios[i + 0x14] == '_')
     1596        {
     1597            FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->pu8PcBios + i, cbDmiTables, cNumDmiTables);
    16011598            break;
    16021599        }
Note: See TracChangeset for help on using the changeset viewer.

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