Title: [252410] trunk/Source/WebKit
Revision
252410
Author
cdu...@apple.com
Date
2019-11-13 08:16:42 -0800 (Wed, 13 Nov 2019)

Log Message

Rollout(r251358) Causes load hangs
https://bugs.webkit.org/show_bug.cgi?id=204158
<rdar://problem/57120002>

Unreviewed, revert r251358 because it causes load hangs.

* Platform/spi/Cocoa/SecItemSPI.h: Removed.
* Shared/mac/SecItemRequestData.cpp:
(WebKit::SecItemRequestData::decode):
* Shared/mac/SecItemRequestData.h:
* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (252409 => 252410)


--- trunk/Source/WebKit/ChangeLog	2019-11-13 15:22:36 UTC (rev 252409)
+++ trunk/Source/WebKit/ChangeLog	2019-11-13 16:16:42 UTC (rev 252410)
@@ -1,3 +1,17 @@
+2019-11-13  Chris Dumez  <cdu...@apple.com>
+
+        Rollout(r251358) Causes load hangs
+        https://bugs.webkit.org/show_bug.cgi?id=204158
+        <rdar://problem/57120002>
+
+        Unreviewed, revert r251358 because it causes load hangs.
+
+        * Platform/spi/Cocoa/SecItemSPI.h: Removed.
+        * Shared/mac/SecItemRequestData.cpp:
+        (WebKit::SecItemRequestData::decode):
+        * Shared/mac/SecItemRequestData.h:
+        * WebKit.xcodeproj/project.pbxproj:
+
 2019-11-13  Philippe Normand  <pnorm...@igalia.com>
 
         Unreviewed, fix build for ServiceWorkers disabled

Deleted: trunk/Source/WebKit/Platform/spi/Cocoa/SecItemSPI.h (252409 => 252410)


--- trunk/Source/WebKit/Platform/spi/Cocoa/SecItemSPI.h	2019-11-13 15:22:36 UTC (rev 252409)
+++ trunk/Source/WebKit/Platform/spi/Cocoa/SecItemSPI.h	2019-11-13 16:16:42 UTC (rev 252410)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <Security/SecAccessControl.h>
-#include <Security/SecBase.h>
-#include <Security/SecCertificate.h>
-#include <Security/SecIdentity.h>
-#include <Security/SecPolicy.h>
-#include <Security/SecTrust.h>
-
-#if PLATFORM(MAC)
-#include <Security/SecACL.h>
-#include <Security/SecAccess.h>
-#include <Security/SecTrustedApplication.h>
-#endif
-
-#if USE(APPLE_INTERNAL_SDK)
-
-#include <Security/SecCode.h>
-#include <Security/SecRequirement.h>
-#include <Security/SecStaticCode.h>
-
-#else
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-CF_ASSUME_NONNULL_BEGIN
-
-CFTypeID SecCodeGetTypeID();
-CFTypeID SecRequirementGetTypeID();
-CFTypeID SecStaticCodeGetTypeID();
-
-CF_ASSUME_NONNULL_END
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // USE(APPLE_INTERNAL_SDK)

Modified: trunk/Source/WebKit/Shared/mac/SecItemRequestData.cpp (252409 => 252410)


--- trunk/Source/WebKit/Shared/mac/SecItemRequestData.cpp	2019-11-13 15:22:36 UTC (rev 252409)
+++ trunk/Source/WebKit/Shared/mac/SecItemRequestData.cpp	2019-11-13 16:16:42 UTC (rev 252410)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,8 +28,6 @@
 
 #include "ArgumentCoders.h"
 #include "ArgumentCodersCF.h"
-#include "SecItemSPI.h"
-#include <CoreFoundation/CoreFoundation.h>
 
 namespace WebKit {
 
@@ -64,86 +62,6 @@
         IPC::encode(encoder, m_attributesToMatch.get());
 }
 
-static bool isValidType(CFTypeRef);
-
-static bool arrayContainsInvalidType(CFArrayRef array)
-{
-    CFIndex entryCount = CFArrayGetCount(array);
-
-    for (CFIndex entry = 0; entry < entryCount; ++entry) {
-        CFTypeRef value = reinterpret_cast<CFTypeRef>(CFArrayGetValueAtIndex(array, entry));
-        if (!isValidType(value))
-            return true;
-    }
-
-    return false;
-}
-
-static bool dictionaryContainsInvalidType(CFDictionaryRef dict)
-{
-    CFIndex entryCount = CFDictionaryGetCount(dict);
-
-    Vector<const void*> keys(entryCount);
-    Vector<const void*> values(entryCount);
-    CFDictionaryGetKeysAndValues(dict, keys.data(), values.data());
-
-    for (CFIndex entry = 0; entry < entryCount; ++entry) {
-        CFTypeRef key = reinterpret_cast<CFTypeRef>(keys[entry]);
-        if (!isValidType(key))
-            return true;
-
-        CFTypeRef value = reinterpret_cast<CFTypeRef>(values[entry]);
-        if (!isValidType(value))
-            return true;
-    }
-
-    return false;
-}
-
-#if PLATFORM(MAC)
-typedef std::array<CFTypeID, 16> ValidTypes;
-#else
-typedef std::array<CFTypeID, 13> ValidTypes;
-#endif
-
-static const ValidTypes& validTypeIDs()
-{
-    static ValidTypes types = {{
-        CFBooleanGetTypeID(), CFDataGetTypeID(), CFStringGetTypeID(), CFNullGetTypeID(), CFNumberGetTypeID(),
-        SecAccessControlGetTypeID(), SecCertificateGetTypeID(), SecCodeGetTypeID(), SecIdentityGetTypeID(),
-        SecPolicyGetTypeID(), SecRequirementGetTypeID(), SecStaticCodeGetTypeID(), SecTrustGetTypeID()
-#if PLATFORM(MAC)
-        , SecACLGetTypeID(), SecAccessGetTypeID(), SecTrustedApplicationGetTypeID()
-#endif
-    }};
-
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        std::sort(types.begin(), types.end());
-    });
-
-    return types;
-}
-
-static bool isValidType(CFTypeRef type)
-{
-    auto typeID = CFGetTypeID(type);
-    if (typeID == CFDictionaryGetTypeID())
-        return !dictionaryContainsInvalidType(reinterpret_cast<CFDictionaryRef>(type));
-
-    if (typeID == CFArrayGetTypeID())
-        return !arrayContainsInvalidType(reinterpret_cast<CFArrayRef>(type));
-
-    const auto& validTypes = validTypeIDs();
-    
-    bool validType = std::binary_search(validTypes.begin(), validTypes.end(), typeID);
-    if (!validType) {
-        String typeName { adoptCF(CFCopyTypeIDDescription(typeID)).get() };
-        WTFLogAlways("SecItemRequestData::decode: Attempted to serialized invalid type %s", typeName.utf8().data());
-    }
-    return validType;
-}
-
 bool SecItemRequestData::decode(IPC::Decoder& decoder, SecItemRequestData& secItemRequestData)
 {
     if (!decoder.decodeEnum(secItemRequestData.m_type))
@@ -153,26 +71,16 @@
     if (!decoder.decode(expectQuery))
         return false;
 
-    if (expectQuery) {
-        if (!IPC::decode(decoder, secItemRequestData.m_queryDictionary))
-            return false;
-
-        if (dictionaryContainsInvalidType(secItemRequestData.m_queryDictionary.get()))
-            return false;
-    }
+    if (expectQuery && !IPC::decode(decoder, secItemRequestData.m_queryDictionary))
+        return false;
     
     bool expectAttributes;
     if (!decoder.decode(expectAttributes))
         return false;
     
-    if (expectAttributes) {
-        if (!IPC::decode(decoder, secItemRequestData.m_attributesToMatch))
-            return false;
-
-        if (dictionaryContainsInvalidType(secItemRequestData.m_attributesToMatch.get()))
-            return false;
-    }
-
+    if (expectAttributes && !IPC::decode(decoder, secItemRequestData.m_attributesToMatch))
+        return false;
+    
     return true;
 }
 

Modified: trunk/Source/WebKit/Shared/mac/SecItemRequestData.h (252409 => 252410)


--- trunk/Source/WebKit/Shared/mac/SecItemRequestData.h	2019-11-13 15:22:36 UTC (rev 252409)
+++ trunk/Source/WebKit/Shared/mac/SecItemRequestData.h	2019-11-13 16:16:42 UTC (rev 252410)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,7 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef SecItemRequestData_h
+#define SecItemRequestData_h
 
 #include <wtf/RetainPtr.h>
 
@@ -63,3 +64,5 @@
 };
     
 } // namespace WebKit
+
+#endif // SecItemRequestData_h

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (252409 => 252410)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-11-13 15:22:36 UTC (rev 252409)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-11-13 16:16:42 UTC (rev 252410)
@@ -1184,7 +1184,6 @@
 		7A8A9D581EF119B0009801AE /* APIInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */; };
 		7A8A9D5A1EF13029009801AE /* APIInjectedBundleBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */; };
 		7A8A9D5C1EF14598009801AE /* APIInjectedBundlePageResourceLoadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */; };
-		7AA746D523593D8100095050 /* SecItemSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA746D42359308400095050 /* SecItemSPI.h */; };
 		7AB6EA451EEAAE3800037B2B /* APIIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB6EA441EEAAE2300037B2B /* APIIconDatabaseClient.h */; };
 		7AB6EA471EEAB6B800037B2B /* APIGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB6EA461EEAB6B000037B2B /* APIGeolocationProvider.h */; };
 		7AF236211E79A40800438A05 /* WebErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF2361F1E79A3D800438A05 /* WebErrors.h */; };
@@ -3790,7 +3789,6 @@
 		7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleClient.h; sourceTree = "<group>"; };
 		7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleBundleClient.h; sourceTree = "<group>"; };
 		7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
-		7AA746D42359308400095050 /* SecItemSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemSPI.h; sourceTree = "<group>"; };
 		7AB4EA3F22777C460085BBAA /* SandboxExtensionCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SandboxExtensionCocoa.mm; sourceTree = "<group>"; };
 		7AB4EA4122777FC70085BBAA /* SandboxInitialiationParametersCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SandboxInitialiationParametersCocoa.mm; sourceTree = "<group>"; };
 		7AB4EA42227780DD0085BBAA /* SandboxUtilities.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SandboxUtilities.mm; sourceTree = "<group>"; };
@@ -6296,7 +6294,6 @@
 				3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */,
 				37B47E2C1D64DB76005F4EFF /* objcSPI.h */,
 				0E97D74C200E8FF300BF6643 /* SafeBrowsingSPI.h */,
-				7AA746D42359308400095050 /* SecItemSPI.h */,
 			);
 			path = Cocoa;
 			sourceTree = "<group>";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to