儲存庫 vbox 的更動 52404
- 時間撮記:
- 2014-8-19 上午12:52:17 (10 年 以前)
- 位置:
- trunk/src/VBox/HostDrivers/Support
- 檔案:
-
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r52403 r52404 143 143 $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,) \ 144 144 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \ 145 VBOX_PERMIT_MORE 145 VBOX_PERMIT_MORE \ 146 VBOX_PERMIT_EVEN_MORE 146 147 SUPR3_INCS := $(PATH_SUB_CURRENT) 147 148 SUPR3_SOURCES = \ … … 185 186 $(if $(VBOX_WITHOUT_DEBUGGER_CHECKS),VBOX_WITHOUT_DEBUGGER_CHECKS,) \ 186 187 $(if $(VBOX_PERMIT_VISUAL_STUDIO_PROFILING),VBOX_PERMIT_VISUAL_STUDIO_PROFILING,) \ 187 VBOX_PERMIT_MORE 188 VBOX_PERMIT_MORE \ 189 VBOX_PERMIT_EVEN_MORE 188 190 ifdef VBOX_WITH_VISTA_NO_SP 189 191 SUPR3HardenedStatic_DEFS.win += VBOX_WITH_VISTA_NO_SP … … 563 565 VBoxDrv_DEFS += VBOX_PERMIT_VISUAL_STUDIO_PROFILING 564 566 endif 565 VBoxDrv_DEFS += VBOX_PERMIT_MORE 567 VBoxDrv_DEFS += VBOX_PERMIT_MORE VBOX_PERMIT_EVEN_MORE 566 568 #VBoxDrv_DEFS.debug += DEBUG_DARWIN_GIP 567 569 VBoxDrv_DEFS.darwin := VBOX_WITH_HOST_VMX -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
r52403 r52404 69 69 * enough a good while. */ 70 70 #define SUPHARDNTVI_MAX_CAT_HASH_SIZE 128 71 72 73 #if defined(VBOX_PERMIT_EVEN_MORE) && !defined(VBOX_PERMIT_MORE) 74 # error "VBOX_PERMIT_EVEN_MORE without VBOX_PERMIT_MORE!" 75 #endif 71 76 72 77 … … 728 733 version. If it should, it's likely to be a fake. */ 729 734 /** @todo list of signed dlls for various windows versions. */ 730 SUP_DPRINTF(("supHardNtViCheckIfNotSignedOk: VINF_LDRVI_NOT_SIGNED\n"));731 735 return VINF_LDRVI_NOT_SIGNED; 732 736 #else … … 735 739 } 736 740 741 737 742 #ifndef IN_RING0 738 743 /* … … 753 758 return rc; 754 759 755 if ( (fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 756 && supHardNtViCheckIsOwnedByTrustedInstaller(hFile, pwszName)) 757 return VINF_LDRVI_NOT_SIGNED; 758 return rc; 759 } 760 #endif /* !IN_RING0 */ 761 762 #ifdef VBOX_PERMIT_MORE 763 /* 764 * AppPatch whitelist. 765 */ 766 if (supHardViIsAppPatchDir(pwszName, cwcName)) 767 { 768 cwcOther = g_System32NtPath.UniStr.Length / sizeof(WCHAR); /* ASSUMES System32 is called System32. */ 769 pwsz = pwszName + cwcOther + 1; 770 760 /* Must be owned by trusted installer. */ 771 761 if ( !(fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 772 762 && !supHardNtViCheckIsOwnedByTrustedInstaller(hFile, pwszName)) 773 763 return rc; 774 764 return VINF_LDRVI_NOT_SIGNED; 765 } 766 #endif /* !IN_RING0 */ 767 768 769 #ifdef VBOX_PERMIT_MORE 770 /* 771 * AppPatch whitelist. 772 */ 773 if (supHardViIsAppPatchDir(pwszName, cwcName)) 774 { 775 cwcOther = g_System32NtPath.UniStr.Length / sizeof(WCHAR); /* ASSUMES System32 is called System32. */ 776 pwsz = pwszName + cwcOther + 1; 777 778 if ( !(fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 779 && !supHardNtViCheckIsOwnedByTrustedInstaller(hFile, pwszName)) 780 return rc; 781 782 # ifndef VBOX_PERMIT_EVEN_MORE 775 783 if (supHardViUtf16PathIsEqual(pwsz, "acres.dll")) 776 784 return VINF_LDRVI_NOT_SIGNED; 777 785 778 # ifdef RT_ARCH_AMD64786 # ifdef RT_ARCH_AMD64 779 787 if (supHardViUtf16PathIsEqual(pwsz, "AppPatch64\\AcGenral.dll")) 780 788 return VINF_LDRVI_NOT_SIGNED; 781 # elif defined(RT_ARCH_X86)789 # elif defined(RT_ARCH_X86) 782 790 if (supHardViUtf16PathIsEqual(pwsz, "AcGenral.dll")) 783 791 return VINF_LDRVI_NOT_SIGNED; 792 # endif 793 # endif /* !VBOX_PERMIT_EVEN_MORE */ 794 795 # ifdef IN_RING0 796 return rc; 797 # else 798 return VINF_LDRVI_NOT_SIGNED; 784 799 # endif 785 786 # ifndef IN_RING0787 return VINF_LDRVI_NOT_SIGNED;788 # else789 return rc;790 # endif791 800 } 792 801 #endif /* VBOX_PERMIT_MORE */ 793 802 794 #if !defined(IN_RING0) && defined(VBOX_PERMIT_MORE) 803 804 #ifndef IN_RING0 805 # if defined(VBOX_PERMIT_MORE) && !defined(VBOX_PERMIT_EVEN_MORE) 795 806 /* 796 807 * Program files and common files. … … 813 824 ) 814 825 { 815 if ( (fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 816 && supHardNtViCheckIsOwnedByTrustedInstaller(hFile, pwszName)) 817 return VINF_LDRVI_NOT_SIGNED; 818 return rc; 819 } 820 #endif /* !IN_RING0 && VBOX_PERMIT_MORE*/ 821 826 if ( !(fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 827 && !supHardNtViCheckIsOwnedByTrustedInstaller(hFile, pwszName)) 828 return rc; 829 return VINF_LDRVI_NOT_SIGNED; 830 } 831 832 # elif defined(VBOX_PERMIT_MORE) && defined(VBOX_PERMIT_EVEN_MORE) 833 /* 834 * Anything that's owned by the trusted installer. 835 */ 836 if ( (fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 837 || supHardNtViCheckIsOwnedByTrustedInstaller(hFile, pwszName)) 838 return VINF_LDRVI_NOT_SIGNED; 839 840 # endif 841 #endif /* !IN_RING0 */ 842 843 /* 844 * Not permitted. 845 */ 822 846 return rc; 823 847 } -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r52403 r52404 1173 1173 } 1174 1174 1175 #ifndef VBOX_PERMIT_EVEN_MORE 1175 1176 /* 1176 1177 * Check the path. We don't allow DLLs to be loaded from just anywhere: … … 1183 1184 * 7. x86 variations of 4 & 5 - ditto. 1184 1185 */ 1185 bool fSystem32 = false;1186 1186 Assert(g_SupLibHardenedExeNtPath.UniStr.Buffer[g_offSupLibHardenedExeNtName - 1] == '\\'); 1187 1187 uint32_t fFlags = 0; 1188 1188 if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_System32NtPath.UniStr, true /*fCheckSlash*/)) 1189 {1190 fSystem32 = true;1191 1189 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; 1192 }1193 1190 else if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_WinSxSNtPath.UniStr, true /*fCheckSlash*/)) 1194 1191 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; … … 1197 1194 g_offSupLibHardenedExeNtName, false /*fCheckSlash*/)) 1198 1195 fFlags |= SUPHNTVI_F_REQUIRE_KERNEL_CODE_SIGNING | SUPHNTVI_F_REQUIRE_SIGNATURE_ENFORCEMENT; 1199 # ifdef VBOX_PERMIT_MORE1196 # ifdef VBOX_PERMIT_MORE 1200 1197 else if (supHardViIsAppPatchDir(uBuf.UniStr.Buffer, uBuf.UniStr.Length / sizeof(WCHAR))) 1201 1198 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; … … 1204 1201 else if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_CommonFilesNtPath.UniStr, true /*fCheckSlash*/)) 1205 1202 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; 1206 # ifdef RT_ARCH_AMD641203 # ifdef RT_ARCH_AMD64 1207 1204 else if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_ProgramFilesX86NtPath.UniStr, true /*fCheckSlash*/)) 1208 1205 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; 1209 1206 else if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_CommonFilesX86NtPath.UniStr, true /*fCheckSlash*/)) 1210 1207 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; 1208 # endif 1211 1209 # endif 1212 #endif 1213 #ifdef VBOX_PERMIT_VISUAL_STUDIO_PROFILING 1210 # ifdef VBOX_PERMIT_VISUAL_STUDIO_PROFILING 1214 1211 /* Hack to allow profiling our code with Visual Studio. */ 1215 1212 else if ( uBuf.UniStr.Length > sizeof(L"\\SamplingRuntime.dll") … … 1222 1219 return STATUS_SUCCESS; 1223 1220 } 1224 # endif1221 # endif 1225 1222 else 1226 1223 { … … 1232 1229 return STATUS_TRUST_FAILURE; 1233 1230 } 1231 1232 #else /* VBOX_PERMIT_EVEN_MORE */ 1233 /* 1234 * Require trusted installer + some kind of signature on everything, except 1235 * for the VBox bits where we require kernel code signing and special 1236 * integrity checks. 1237 */ 1238 Assert(g_SupLibHardenedExeNtPath.UniStr.Buffer[g_offSupLibHardenedExeNtName - 1] == '\\'); 1239 uint32_t fFlags = 0; 1240 if (supHardViUtf16PathStartsWithEx(uBuf.UniStr.Buffer, uBuf.UniStr.Length / sizeof(WCHAR), 1241 g_SupLibHardenedExeNtPath.UniStr.Buffer, 1242 g_offSupLibHardenedExeNtName, false /*fCheckSlash*/)) 1243 fFlags |= SUPHNTVI_F_REQUIRE_KERNEL_CODE_SIGNING | SUPHNTVI_F_REQUIRE_SIGNATURE_ENFORCEMENT; 1244 else 1245 fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER; 1246 #endif /* VBOX_PERMIT_EVEN_MORE */ 1234 1247 1235 1248 /*
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器