Changeset 85543 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jul 30, 2020 9:06:35 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139611
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r85542 r85543 5255 5255 pImage->paSegments[iSeg].fProt); 5256 5256 } 5257 if (iSeg >= pImage->cSegments)5258 {5259 supdrvLdrUnlock(pDevExt);5260 return supdrvLdrLoadError(VERR_INVALID_PARAMETER, pReq,5261 "Bad entry point %p given for %s: no matching segment found (RVA %#zx)!",5262 pv, pszSymbol, uRva);5263 }5264 5257 5265 5258 if (pImage->fNative) … … 5342 5335 } 5343 5336 5344 /*5345 * Copy the segments before we start using supdrvLdrValidatePointer for entrypoint validation.5346 */5347 pImage->cSegments = pReq->u.In.cSegments;5348 {5349 size_t cbSegments = pImage->cSegments * sizeof(SUPLDRSEG);5350 pImage->paSegments = (PSUPLDRSEG)RTMemDup(&pReq->u.In.abImage[pReq->u.In.offSegments], cbSegments);5351 if (pImage->paSegments) /* Align the last segment size to avoid upsetting RTR0MemObjProtect. */ /** @todo relax RTR0MemObjProtect */5352 pImage->paSegments[pImage->cSegments - 1].cb = RT_ALIGN_32(pImage->paSegments[pImage->cSegments - 1].cb, PAGE_SIZE);5353 else5354 {5355 supdrvLdrUnlock(pDevExt);5356 return supdrvLdrLoadError(VERR_NO_MEMORY, pReq, "Out of memory for segment table: %#x", cbSegments);5357 }5358 SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING);5359 }5360 5361 /*5362 * Validate entrypoints.5363 */5364 5337 switch (pReq->u.In.eEPType) 5365 5338 { … … 5431 5404 if (!pImage->paSymbols) 5432 5405 rc = supdrvLdrLoadError(VERR_NO_MEMORY, pReq, "Out of memory for symbol table: %#x", cbSymbols); 5406 SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING); 5407 } 5408 5409 pImage->cSegments = pReq->u.In.cSegments; 5410 if (RT_SUCCESS(rc)) 5411 { 5412 size_t cbSegments = pImage->cSegments * sizeof(SUPLDRSEG); 5413 pImage->paSegments = (PSUPLDRSEG)RTMemDup(&pReq->u.In.abImage[pReq->u.In.offSegments], cbSegments); 5414 if (pImage->paSegments) /* Align the last segment size to avoid upsetting RTR0MemObjProtect. */ /** @todo relax RTR0MemObjProtect */ 5415 pImage->paSegments[pImage->cSegments - 1].cb = RT_ALIGN_32(pImage->paSegments[pImage->cSegments - 1].cb, PAGE_SIZE); 5416 else 5417 rc = supdrvLdrLoadError(VERR_NO_MEMORY, pReq, "Out of memory for segment table: %#x", cbSegments); 5433 5418 SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING); 5434 5419 } -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r85542 r85543 146 146 #endif 147 147 148 #if defined(RT_OS_LINUX)/** @todo make everyone do this */148 #if 0 /*defined(RT_OS_LINUX)*/ /** @todo make everyone do this */ 149 149 /** Use the RTR0MemObj API rather than the RTMemExecAlloc for the images. 150 150 * This is a good idea in general, but a necessity for @bugref{9801}. */ -
trunk/src/VBox/HostDrivers/Support/SUPLibLdr.cpp
r85542 r85543 359 359 RT_NOREF(hLdrMod); 360 360 361 Log2(("supLoadModuleCompileSegmentsCB: %RTptr/%RTptr LB %RTptr/%RTptr prot %#x %s\n",362 pSeg->LinkAddress, pSeg->RVA, pSeg->cbMapped, pSeg->cb, pSeg->fProt, pSeg->pszName));363 364 361 /* Ignore segments not part of the loaded image. */ 365 362 if (pSeg->RVA == NIL_RTLDRADDR || pSeg->cbMapped == 0) 366 {367 Log2(("supLoadModuleCompileSegmentsCB: -> skipped\n"));368 363 return VINF_SUCCESS; 369 }370 364 371 365 /* We currently ASSUME that all relevant segments are in ascending RVA order. */ … … 380 374 AssertReturn(pSeg->RVA < _1G, VERR_INTERNAL_ERROR_3); 381 375 uint32_t uRvaSeg = (uint32_t)pSeg->RVA; 376 Log2(("supLoadModuleCompileSegmentsCB: %RTptr/%RTptr LB %RTptr/%RTptr prot %#x %s\n", 377 pSeg->LinkAddress, pSeg->RVA, pSeg->cbMapped, pSeg->cb, pSeg->fProt, pSeg->pszName)); 382 378 383 379 /*
Note:
See TracChangeset
for help on using the changeset viewer.