Changeset 252413 in webkit
- Timestamp:
- Nov 13, 2019, 10:25:10 AM (7 years ago)
- Location:
- tags/Safari-609.1.10.0.2/Source/WebKit
- Files:
-
- 1 deleted
- 4 edited
-
ChangeLog (modified) (1 diff)
-
Platform/spi/Cocoa/SecItemSPI.h (deleted)
-
Shared/mac/SecItemRequestData.cpp (modified) (5 diffs)
-
Shared/mac/SecItemRequestData.h (modified) (3 diffs)
-
WebKit.xcodeproj/project.pbxproj (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/Safari-609.1.10.0.2/Source/WebKit/ChangeLog
r252388 r252413 1 2019-11-13 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r252410. rdar://problem/57120002 4 5 Rollout(r251358) Causes load hangs 6 https://bugs.webkit.org/show_bug.cgi?id=204158 7 <rdar://problem/57120002> 8 9 Unreviewed, revert r251358 because it causes load hangs. 10 11 * Platform/spi/Cocoa/SecItemSPI.h: Removed. 12 * Shared/mac/SecItemRequestData.cpp: 13 (WebKit::SecItemRequestData::decode): 14 * Shared/mac/SecItemRequestData.h: 15 * WebKit.xcodeproj/project.pbxproj: 16 17 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252410 268f45cc-cd09-0410-ab3c-d52691b4dbfc 18 19 2019-11-13 Chris Dumez <cdumez@apple.com> 20 21 Rollout(r251358) Causes load hangs 22 https://bugs.webkit.org/show_bug.cgi?id=204158 23 <rdar://problem/57120002> 24 25 Unreviewed, revert r251358 because it causes load hangs. 26 27 * Platform/spi/Cocoa/SecItemSPI.h: Removed. 28 * Shared/mac/SecItemRequestData.cpp: 29 (WebKit::SecItemRequestData::decode): 30 * Shared/mac/SecItemRequestData.h: 31 * WebKit.xcodeproj/project.pbxproj: 32 1 33 2019-11-12 Kocsen Chung <kocsen_chung@apple.com> 2 34 -
tags/Safari-609.1.10.0.2/Source/WebKit/Shared/mac/SecItemRequestData.cpp
r251358 r252413 1 1 /* 2 * Copyright (C) 2011 -2019Apple Inc. All rights reserved.2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "ArgumentCoders.h" 30 30 #include "ArgumentCodersCF.h" 31 #include "SecItemSPI.h"32 #include <CoreFoundation/CoreFoundation.h>33 31 34 32 namespace WebKit { … … 65 63 } 66 64 67 static bool isValidType(CFTypeRef);68 69 static bool arrayContainsInvalidType(CFArrayRef array)70 {71 CFIndex entryCount = CFArrayGetCount(array);72 73 for (CFIndex entry = 0; entry < entryCount; ++entry) {74 CFTypeRef value = reinterpret_cast<CFTypeRef>(CFArrayGetValueAtIndex(array, entry));75 if (!isValidType(value))76 return true;77 }78 79 return false;80 }81 82 static bool dictionaryContainsInvalidType(CFDictionaryRef dict)83 {84 CFIndex entryCount = CFDictionaryGetCount(dict);85 86 Vector<const void*> keys(entryCount);87 Vector<const void*> values(entryCount);88 CFDictionaryGetKeysAndValues(dict, keys.data(), values.data());89 90 for (CFIndex entry = 0; entry < entryCount; ++entry) {91 CFTypeRef key = reinterpret_cast<CFTypeRef>(keys[entry]);92 if (!isValidType(key))93 return true;94 95 CFTypeRef value = reinterpret_cast<CFTypeRef>(values[entry]);96 if (!isValidType(value))97 return true;98 }99 100 return false;101 }102 103 #if PLATFORM(MAC)104 typedef std::array<CFTypeID, 16> ValidTypes;105 #else106 typedef std::array<CFTypeID, 13> ValidTypes;107 #endif108 109 static const ValidTypes& validTypeIDs()110 {111 static ValidTypes types = {{112 CFBooleanGetTypeID(), CFDataGetTypeID(), CFStringGetTypeID(), CFNullGetTypeID(), CFNumberGetTypeID(),113 SecAccessControlGetTypeID(), SecCertificateGetTypeID(), SecCodeGetTypeID(), SecIdentityGetTypeID(),114 SecPolicyGetTypeID(), SecRequirementGetTypeID(), SecStaticCodeGetTypeID(), SecTrustGetTypeID()115 #if PLATFORM(MAC)116 , SecACLGetTypeID(), SecAccessGetTypeID(), SecTrustedApplicationGetTypeID()117 #endif118 }};119 120 static dispatch_once_t onceToken;121 dispatch_once(&onceToken, ^{122 std::sort(types.begin(), types.end());123 });124 125 return types;126 }127 128 static bool isValidType(CFTypeRef type)129 {130 auto typeID = CFGetTypeID(type);131 if (typeID == CFDictionaryGetTypeID())132 return !dictionaryContainsInvalidType(reinterpret_cast<CFDictionaryRef>(type));133 134 if (typeID == CFArrayGetTypeID())135 return !arrayContainsInvalidType(reinterpret_cast<CFArrayRef>(type));136 137 const auto& validTypes = validTypeIDs();138 139 bool validType = std::binary_search(validTypes.begin(), validTypes.end(), typeID);140 if (!validType) {141 String typeName { adoptCF(CFCopyTypeIDDescription(typeID)).get() };142 WTFLogAlways("SecItemRequestData::decode: Attempted to serialized invalid type %s", typeName.utf8().data());143 }144 return validType;145 }146 147 65 bool SecItemRequestData::decode(IPC::Decoder& decoder, SecItemRequestData& secItemRequestData) 148 66 { … … 154 72 return false; 155 73 156 if (expectQuery) { 157 if (!IPC::decode(decoder, secItemRequestData.m_queryDictionary)) 158 return false; 159 160 if (dictionaryContainsInvalidType(secItemRequestData.m_queryDictionary.get())) 161 return false; 162 } 74 if (expectQuery && !IPC::decode(decoder, secItemRequestData.m_queryDictionary)) 75 return false; 163 76 164 77 bool expectAttributes; … … 166 79 return false; 167 80 168 if (expectAttributes) { 169 if (!IPC::decode(decoder, secItemRequestData.m_attributesToMatch)) 170 return false; 171 172 if (dictionaryContainsInvalidType(secItemRequestData.m_attributesToMatch.get())) 173 return false; 174 } 175 81 if (expectAttributes && !IPC::decode(decoder, secItemRequestData.m_attributesToMatch)) 82 return false; 83 176 84 return true; 177 85 } -
tags/Safari-609.1.10.0.2/Source/WebKit/Shared/mac/SecItemRequestData.h
r251358 r252413 1 1 /* 2 * Copyright (C) 2011 -2019Apple Inc. All rights reserved.2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #pragma once 26 #ifndef SecItemRequestData_h 27 #define SecItemRequestData_h 27 28 28 29 #include <wtf/RetainPtr.h> … … 64 65 65 66 } // namespace WebKit 67 68 #endif // SecItemRequestData_h -
tags/Safari-609.1.10.0.2/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r251952 r252413 1181 1181 7A8A9D5A1EF13029009801AE /* APIInjectedBundleBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */; }; 1182 1182 7A8A9D5C1EF14598009801AE /* APIInjectedBundlePageResourceLoadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */; }; 1183 7AA746D523593D8100095050 /* SecItemSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA746D42359308400095050 /* SecItemSPI.h */; };1184 1183 7AB6EA451EEAAE3800037B2B /* APIIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB6EA441EEAAE2300037B2B /* APIIconDatabaseClient.h */; }; 1185 1184 7AB6EA471EEAB6B800037B2B /* APIGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB6EA461EEAB6B000037B2B /* APIGeolocationProvider.h */; }; … … 3781 3780 7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleBundleClient.h; sourceTree = "<group>"; }; 3782 3781 7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; }; 3783 7AA746D42359308400095050 /* SecItemSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemSPI.h; sourceTree = "<group>"; };3784 3782 7AB4EA3F22777C460085BBAA /* SandboxExtensionCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SandboxExtensionCocoa.mm; sourceTree = "<group>"; }; 3785 3783 7AB4EA4122777FC70085BBAA /* SandboxInitialiationParametersCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SandboxInitialiationParametersCocoa.mm; sourceTree = "<group>"; }; … … 6287 6285 37B47E2C1D64DB76005F4EFF /* objcSPI.h */, 6288 6286 0E97D74C200E8FF300BF6643 /* SafeBrowsingSPI.h */, 6289 7AA746D42359308400095050 /* SecItemSPI.h */,6290 6287 ); 6291 6288 path = Cocoa;
Note:
See TracChangeset
for help on using the changeset viewer.