Changeset 39086 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Oct 24, 2011 9:39:47 AM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r37955 r39086 580 580 static int supCallVMMR0ExFake(PVMR0 pVMR0, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr) 581 581 { 582 AssertMsgFailed(("%d\n", uOperation)); 582 AssertMsgFailed(("%d\n", uOperation)); NOREF(pVMR0); NOREF(uOperation); NOREF(u64Arg); NOREF(pReqHdr); 583 583 return VERR_NOT_SUPPORTED; 584 584 } … … 587 587 SUPR3DECL(int) SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu) 588 588 { 589 NOREF(pVMR0); 589 590 if (RT_LIKELY(uOperation == SUP_VMMR0_DO_RAW_RUN)) 590 591 return suplibOsIOCtlFast(&g_supLibData, SUP_IOCTL_FAST_DO_RAW_RUN, idCpu); … … 1040 1041 AssertPtrNullReturn(paPages, VERR_INVALID_POINTER); 1041 1042 AssertMsgReturn(cPages > 0 && cPages <= VBOX_MAX_ALLOC_PAGE_COUNT, ("cPages=%zu\n", cPages), VERR_PAGE_COUNT_OUT_OF_RANGE); 1043 AssertReturn(!fFlags, VERR_INVALID_PARAMETER); 1042 1044 1043 1045 /* fake */ … … 1538 1540 return rc; 1539 1541 #else 1542 NOREF(pszDirPath); NOREF(fRecursive); NOREF(fCheckFiles); 1540 1543 return VINF_SUCCESS; 1541 1544 #endif … … 1615 1618 const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser) 1616 1619 { 1620 NOREF(hLdrMod); NOREF(pvUser); NOREF(uSymbol); 1617 1621 AssertPtr(pValue); 1618 1622 AssertPtr(pvUser); … … 1754 1758 pArgs->cbStrings += strlen(pszSymbol) + 1; 1755 1759 } 1760 NOREF(hLdrMod); NOREF(uSymbol); 1756 1761 return VINF_SUCCESS; 1757 1762 } … … 1786 1791 pArgs->psz += cbCopy; 1787 1792 } 1793 NOREF(hLdrMod); NOREF(uSymbol); 1788 1794 return VINF_SUCCESS; 1789 1795 } … … 2232 2238 SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, PRTERRINFO pErrInfo) 2233 2239 { 2234 int rc;2235 2236 2240 /* 2237 2241 * Validate input. … … 2247 2251 * Verify the image file. 2248 2252 */ 2249 rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pErrInfo);2253 int rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pErrInfo); 2250 2254 if (RT_FAILURE(rc)) 2251 2255 { -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
r37344 r39086 278 278 */ 279 279 int rc = supR3HardenedMakePath(pFile->enmDir, pszDst, cchDst, fFatal); 280 if (RT_SUCCESS(rc) )280 if (RT_SUCCESS(rc) && fWithFilename) 281 281 { 282 282 size_t cchFile = strlen(pFile->pszFile); … … 456 456 { 457 457 char szPath[RTPATH_MAX]; 458 rc = supR3HardenedMakeFilePath(pFile, szPath, sizeof(szPath), true , fFatal);458 rc = supR3HardenedMakeFilePath(pFile, szPath, sizeof(szPath), true /*fWithFilename*/, fFatal); 459 459 if (RT_SUCCESS(rc)) 460 460 { … … 1135 1135 #if defined(RT_OS_WINDOWS) 1136 1136 /** @todo Windows hardening. */ 1137 NOREF(pFsObjState); NOREF(fDir); NOREF(fRelaxed); NOREF(pszPath); NOREF(pErrInfo); 1137 1138 return VINF_SUCCESS; 1138 1139 1139 1140 #elif defined(RT_OS_OS2) 1140 1141 /* No hardening here - it's a single user system. */ 1142 NOREF(pFsObjState); NOREF(fDir); NOREF(fRelaxed); NOREF(pszPath); NOREF(pErrInfo); 1141 1143 return VINF_SUCCESS; 1142 1144 … … 1186 1188 full access. So, to work around we relax the hardening a bit and 1187 1189 permit grand parents and beyond to be group writable by admin. */ 1188 if ( pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */1190 if (!fRelaxed || pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */ 1189 1191 #elif defined(RT_OS_FREEBSD) 1190 1192 /* HACK ALERT: PC-BSD 9 has group-writable application directory, 1191 similar to OS X and their /Applications directory (see above). */ 1192 if (pFsObjState->Stat.st_gid != 5 /*operators*/) 1193 similar to OS X and their /Applications directory (see above). 1194 On FreeBSD root is normally the only member of this group. */ 1195 /** @todo Can we test for fRelaxed here like on the mac or is the 'operator' 1196 * group the owner of the immediate installation directory? More 1197 * details would be greatly appreciated as this HACK affects real FreeBSD 1198 * as well as the PC-BSD fork! */ 1199 if (pFsObjState->Stat.st_gid != 5 /*operator*/) 1193 1200 #endif 1194 1201 return supR3HardenedSetError3(VERR_SUPLIB_WRITE_NON_SYS_GROUP, pErrInfo,
Note:
See TracChangeset
for help on using the changeset viewer.