REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegment...
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Oct 2019 20:25:40 +0000 (20:25 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Oct 2019 20:25:40 +0000 (20:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201902

Reviewed by Ryosuke Niwa.

Source/WebCore:

* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):

Source/WTF:

* wtf/Vector.h:
The code introduced in r108153 to workaround a warning when building Chrome was causing us to use uninitialized memory
when we create a Vector with the size_t/{signed,unsigned}char constructor with a constexpr size_t.
This was the cause of bug 201902 and bug 201620 which only manifested themselves in release builds with some compilers.

Tools:

* TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251089 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/Vector.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/webauthn/fido/U2fResponseConverter.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp

index 4879943..df39307 100644 (file)
@@ -1,3 +1,15 @@
+2019-10-14  Alex Christensen  <achristensen@webkit.org>
+
+        REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
+        https://bugs.webkit.org/show_bug.cgi?id=201902
+
+        Reviewed by Ryosuke Niwa.
+
+        * wtf/Vector.h:
+        The code introduced in r108153 to workaround a warning when building Chrome was causing us to use uninitialized memory
+        when we create a Vector with the size_t/{signed,unsigned}char constructor with a constexpr size_t.
+        This was the cause of bug 201902 and bug 201620 which only manifested themselves in release builds with some compilers.
+
 2019-10-14  Per Arne Vollan  <pvollan@apple.com>
 
         [macOS] Sandbox extensions should be created with audit tokens, not PIDs
index 74e5aba..a4ed6ee 100644 (file)
@@ -204,10 +204,7 @@ struct VectorFiller<true, T>
     static void uninitializedFill(T* dst, T* dstEnd, const T& val) 
     {
         static_assert(sizeof(T) == 1, "Size of type T should be equal to one!");
-#if COMPILER(GCC_COMPATIBLE) && defined(_FORTIFY_SOURCE)
-        if (!__builtin_constant_p(dstEnd - dst) || (!(dstEnd - dst)))
-#endif
-            memset(dst, val, dstEnd - dst);
+        memset(dst, val, dstEnd - dst);
     }
 };
 
index c1f3eb1..92df240 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-14  Alex Christensen  <achristensen@webkit.org>
+
+        REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
+        https://bugs.webkit.org/show_bug.cgi?id=201902
+
+        Reviewed by Ryosuke Niwa.
+
+        * Modules/webauthn/fido/U2fResponseConverter.cpp:
+        (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
+
 2019-10-14  Russell Epstein  <russell_e@apple.com>
 
         Unreviewed, rolling out r251081.
index ca6e38a..9324f18 100644 (file)
@@ -98,9 +98,7 @@ static Vector<uint8_t> createAttestedCredentialDataFromU2fRegisterResponse(const
     if (credentialId.isEmpty())
         return { };
 
-    Vector<uint8_t> aaguid(aaguidLength);
-    memset(aaguid.data(), 0, aaguidLength);
-    return buildAttestedCredentialData(aaguid, credentialId, publicKey);
+    return buildAttestedCredentialData(Vector<uint8_t>(aaguidLength, 0), credentialId, publicKey);
 }
 
 static size_t parseX509Length(const Vector<uint8_t>& u2fData, size_t offset)
index 03d5cb4..77e437f 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-14  Alex Christensen  <achristensen@webkit.org>
+
+        REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
+        https://bugs.webkit.org/show_bug.cgi?id=201902
+
+        Reviewed by Ryosuke Niwa.
+
+        * TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:
+        (TestWebKitAPI::TEST_F):
+
 2019-10-14  Saam Barati  <sbarati@apple.com>
 
         Canonicalize how we prepare the prototype chain for inline caching
index 1982731..eb92d50 100644 (file)
@@ -101,7 +101,6 @@ TEST_F(SharedBufferTest, tryCreateArrayBuffer)
     EXPECT_EQ(0, memcmp(expectedConcatenation, arrayBuffer->data(), strlen(expectedConcatenation)));
 }
 
-#if !PLATFORM(IOS) // FIXME: webkit.org/b/201902 REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
 TEST_F(SharedBufferTest, tryCreateArrayBufferLargeSegments)
 {
     Vector<char> vector0(0x4000, 'a');
@@ -127,7 +126,6 @@ TEST_F(SharedBufferTest, tryCreateArrayBufferLargeSegments)
         ++position;
     }
 }
-#endif // !PLATFORM(IOS)
 
 TEST_F(SharedBufferTest, copy)
 {