Changeset 54013 in vbox for trunk/src/VBox/HostDrivers/Support/SUPDrv.c
- Timestamp:
- Jan 28, 2015 1:44:00 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r53843 r54013 148 148 static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDRLOAD pReq); 149 149 static int supdrvIOCtl_LdrFree(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDRFREE pReq); 150 static int supdrvIOCtl_LdrLockDown(PSUPDRVDEVEXT pDevExt); 150 151 static int supdrvIOCtl_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDRGETSYMBOL pReq); 151 152 static int supdrvIDC_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPDRVIDCREQGETSYM pReq); … … 1710 1711 } 1711 1712 1713 case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_LDR_LOCK_DOWN): 1714 { 1715 /* validate */ 1716 REQ_CHECK_SIZES(SUP_IOCTL_LDR_LOCK_DOWN); 1717 1718 /* execute */ 1719 pReqHdr->rc = supdrvIOCtl_LdrLockDown(pDevExt); 1720 return 0; 1721 } 1722 1712 1723 case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_LDR_GET_SYMBOL): 1713 1724 { … … 4557 4568 /* (not found - add it!) */ 4558 4569 4570 /* If the loader interface is locked down, make userland fail early */ 4571 if (pDevExt->fLdrLockedDown) 4572 { 4573 supdrvLdrUnlock(pDevExt); 4574 Log(("supdrvIOCtl_LdrOpen: Not adding '%s' to image list, loader interface is locked down!\n", pReq->u.In.szName)); 4575 return VERR_PERMISSION_DENIED; 4576 } 4577 4559 4578 /* 4560 4579 * Allocate memory. … … 4722 4741 } 4723 4742 4743 /* If the loader interface is locked down, don't load new images */ 4744 if (pDevExt->fLdrLockedDown) 4745 { 4746 supdrvLdrUnlock(pDevExt); 4747 Log(("SUP_IOCTL_LDR_LOAD: Not loading '%s' image bits, loader interface is locked down!\n", pImage->szName)); 4748 return VERR_PERMISSION_DENIED; 4749 } 4750 4724 4751 switch (pReq->u.In.eEPType) 4725 4752 { … … 4984 5011 4985 5012 /** 5013 * Lock down the image loader interface. 5014 * 5015 * @returns IPRT status code. 5016 * @param pDevExt Device globals. 5017 */ 5018 static int supdrvIOCtl_LdrLockDown(PSUPDRVDEVEXT pDevExt) 5019 { 5020 LogFlow(("supdrvIOCtl_LdrLockDown:\n")); 5021 5022 supdrvLdrLock(pDevExt); 5023 if (!pDevExt->fLdrLockedDown) 5024 { 5025 pDevExt->fLdrLockedDown = true; 5026 Log(("supdrvIOCtl_LdrLockDown: Image loader interface locked down\n")); 5027 } 5028 supdrvLdrUnlock(pDevExt); 5029 5030 return VINF_SUCCESS; 5031 } 5032 5033 5034 /** 4986 5035 * Gets the address of a symbol in an open image. 4987 5036 * … … 5252 5301 PSUPDRVLDRIMAGE pImagePrev; 5253 5302 LogFlow(("supdrvLdrFree: pImage=%p\n", pImage)); 5303 5304 /* 5305 * Warn if we're releasing images while the image loader interface is 5306 * locked down -- we won't be able to reload them! 5307 */ 5308 if (pDevExt->fLdrLockedDown) 5309 Log(("supdrvLdrFree: Warning: unloading '%s' image, while loader interface is locked down!\n", pImage->szName)); 5254 5310 5255 5311 /* find it - arg. should've used doubly linked list. */
Note:
See TracChangeset
for help on using the changeset viewer.