Changeset 60699 in vbox
- Timestamp:
- Apr 25, 2016 10:19:52 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106872
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r60467 r60699 3499 3499 { 3500 3500 IMAGE_LOAD_CONFIG_DIRECTORY64 Cfg64; 3501 uint8_t abZeros[sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64_V5) * 4]; 3501 3502 } u; 3502 3503 … … 3525 3526 : sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64_V2) /*No V1*/; 3526 3527 3528 bool fNewerStructureHack = false; 3527 3529 if ( Dir.Size != cbExpectV5 3528 3530 && Dir.Size != cbExpectV4 … … 3531 3533 && Dir.Size != cbExpectV1) 3532 3534 { 3533 Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %u bytes, expected %zu, %zu, %zu, %zu, or %zu.\n", 3534 pszLogName, Dir.Size, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1)); 3535 return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE, 3536 "Unexpected load config dir size of %u bytes; supported sized: %zu, %zu, %zu, %zu, or %zu", 3537 Dir.Size, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1); 3535 fNewerStructureHack = Dir.Size > cbExpectV5 /* These structure changes are slowly getting to us! More futher down. */ 3536 && Dir.Size <= sizeof(u); 3537 Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %u bytes, expected %zu, %zu, %zu, %zu, or %zu.%s\n", 3538 pszLogName, Dir.Size, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1, 3539 fNewerStructureHack ? " Will try ignore extra bytes if all zero." : "")); 3540 if (!fNewerStructureHack) 3541 return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE, 3542 "Unexpected load config dir size of %u bytes; supported sized: %zu, %zu, %zu, %zu, or %zu", 3543 Dir.Size, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1); 3538 3544 } 3539 3545 3540 3546 /* 3541 * Read and convert to 64-bit. 3547 * Read, check new stuff and convert to 64-bit. 3548 * 3549 * If we accepted a newer structure, we check whether the new bits are 3550 * all zero. This PRAYING/ASSUMING that the nothing new weird stuff is 3551 * activated by a zero value and that it'll mostly be unused in areas 3552 * we care about (which has been the case till now). 3542 3553 */ 3543 3554 RT_ZERO(u.Cfg64); … … 3545 3556 if (RT_FAILURE(rc)) 3546 3557 return rc; 3558 if ( fNewerStructureHack 3559 && !ASMMemIsZero(&u.abZeros[cbExpectV5], Dir.Size - cbExpectV5)) 3560 { 3561 Log(("rtldrPEOpen: %s: load cfg dir: Unexpected bytes are non-zero (%u bytes of which %u expected to be zero): %.*Rhxs\n", 3562 pszLogName, Dir.Size, Dir.Size - cbExpectV5, Dir.Size - cbExpectV5, &u.abZeros[cbExpectV5])); 3563 return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE, 3564 "Grown load config (%u to %u bytes) includes non-zero bytes: %.*Rhxs", 3565 cbExpectV5, Dir.Size, Dir.Size - cbExpectV5, &u.abZeros[cbExpectV5]); 3566 } 3547 3567 rtldrPEConvert32BitLoadConfigTo64Bit(&u.Cfg64); 3548 3568
Note:
See TracChangeset
for help on using the changeset viewer.