Repository navigation
Fix crash in onComputeErrorInfo - #29
Merged
Merged
Conversation
Jarred-Sumner
pushed a commit
that referenced
this pull request
Jun 30, 2026
* Remove redundant m_renderRange.start() null checks in RenderHighlight::highlightStateForRenderer
https://bugs.webkit.org/show_bug.cgi?id=318175
rdar://180977788
Reviewed by Alan Baradlay.
The branch is entered only when `&renderer == m_renderRange.start()`. Since
renderer is a reference, &renderer is never null, so m_renderRange.start() is
guaranteed non-null inside the block. The two further m_renderRange.start()
checks were therefore always true: the leading term of the Both test and the
guard on the Start return.
Drop both dead checks. The Start return becomes the unconditional fall-through
after the Both case, and the end() null check is retained since end() can
legitimately be null. No change in behavior.
* Source/WebCore/rendering/RenderHighlight.cpp:
(WebCore::RenderHighlight::highlightStateForRenderer):
Canonical link: https://commits.webkit.org/316115@main
* [GPUP] WebGPU BindGroup Validation-Cache Key Collision Leads to GPU OOB Write
https://bugs.webkit.org/show_bug.cgi?id=313360
rdar://174662781
Reviewed by Dan Glastonbury.
Share identifiers for render and compute pipelines to avoid
validation succeeding for a given bind group + render pipeline
which was validated for the hash key identical to the same
bind group but with a compute pipeline which has the same key.
* Source/WebGPU/WebGPU/ComputePipeline.mm:
* Source/WebGPU/WebGPU/Device.h:
* Source/WebGPU/WebGPU/RenderPipeline.mm:
Originally-landed-as: 305413.739@safari-7624-branch (427fc7a6307d). rdar://180429272
Canonical link: https://commits.webkit.org/316116@main
* Uninitialized-heap disclosure in convertImagePixelsFromFloat16ToFloat16 via color-space early-return
<https://bugs.webkit.org/show_bug.cgi?id=314590>
<rdar://176483321>
Reviewed by Gerald Squelart.
convertImagePixelsFromFloat16ToFloat16() early-returned on a color-space
mismatch without writing the destination. The destination buffer is allocated
via JSC::Float16Array::tryCreateUninitialized() and ImageBufferBackend::
getPixelBuffer() only zero-fills on a size mismatch, so an RGBA16F
getPixelBuffer() readback whose output color space differed from the backing
IOSurface's left the destination populated with uninitialized
Gigacage::Primitive heap. RemoteImageBuffer::getPixelBufferWithNewMemory()
then memcpy'd those bytes into WebContent-mapped shared memory causing a
WebContent<->GPUProcess heap disclosure.
Float16<->Float16 color-space conversion is unimplemented (the 8-bit sibling
path also doesn't perform it). Remove the early return so the destination
is always populated with the source pixels (alpha-format conversion applied),
matching the sibling's behavior and closing the disclosure.
Test: ipc/rgba16f-getpixelbuffer-colorspace-mismatch-heap-disclosure.html
* LayoutTests/ipc/rgba16f-getpixelbuffer-colorspace-mismatch-heap-disclosure-expected.txt: Added.
* LayoutTests/ipc/rgba16f-getpixelbuffer-colorspace-mismatch-heap-disclosure.html: Added.
* Source/WebCore/platform/graphics/PixelBufferConversion.cpp:
(WebCore::convertImagePixelsFromFloat16ToFloat16):
Originally-landed-as: 305413.933@safari-7624-branch (e7a0eda7b7ff). rdar://180428968
Canonical link: https://commits.webkit.org/316117@main
* [JSC] DFGArgumentsEliminationPhase removeViaKill should reset node scan index between InlineCallFrames
https://bugs.webkit.org/show_bug.cgi?id=314850
rdar://176966728
Reviewed by Yusuke Suzuki.
In DFGArgumentsEliminationPhase::eliminateCandidatesThatInterfere(), the removeViaKill
lambda contains two nested loops. The outer loop iterates over inline call frames. For
each frame, the inner loop is expected to iterate the nodes of the given basic block in
reverse order in the range [0, nodeIndex). However, because the inner loop mutates the
lambda parameter nodeIndex directly, this only works as intended for the first inline call
frame. Each subsequent call frame begins where the previous one left off.
The change introduces a separate iteration variable for the inner loop, which starts off
at nodeIndex for each inline call frame. nodeIndex parameter is marked as 'const' to make
explicit the expectation that it should not change.
Test: JSTests/stress/arguments-elimination-multiple-inline-call-frames.js
Originally-landed-as: 305413.912@safari-7624-branch (3270ebdb7366). rdar://180435783
Canonical link: https://commits.webkit.org/316118@main
* [Tools][WPE][browserperfdash-benchmark] browser-binary-size plan plugin should report the sizes of the stripped binaries and libs.
https://bugs.webkit.org/show_bug.cgi?id=318205
Reviewed by Nikolas Zimmermann.
Ensure to strip the binary and libraries before reporting the size.
That is done in a temporal file to not affect the original ones because
the user may want to keep those with debug symbols to use gdb or similar.
* Tools/Scripts/webkitpy/browserperfdash/plans/browser_binary_size.py:
(get_stripped_object_size):
(get_basenames_and_sizes):
(get_browser_relevant_objects_glib):
Canonical link: https://commits.webkit.org/316119@main
* Reject requestStorageAccess() without gesture should not synthesize user activation
https://bugs.webkit.org/show_bug.cgi?id=313478
rdar://174964081
Reviewed by Matthew Finkel.
The completion handler for requestStorageAccess() preserved the user gesture whenever the prompt was
not shown, including on the no-gesture fast-reject path. This synthesized a UserGestureIndicator
from nothing, allowing the .catch handler to call gesture-gated APIs from a cross-site iframe with
zero user interaction.
Gate gesture preservation on a real gesture having existed at call time.
Test: http/tests/storageAccess/request-storage-access-rejected-without-gesture-should-not-activate.html
* LayoutTests/http/tests/storageAccess/request-storage-access-rejected-without-gesture-should-not-activate-expected.txt: Added.
* LayoutTests/http/tests/storageAccess/request-storage-access-rejected-without-gesture-should-not-activate.html: Added.
* LayoutTests/http/tests/storageAccess/resources/request-storage-access-without-gesture-check-activation-iframe.html: Added.
* Source/WebCore/dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccess):
(WebCore::DocumentStorageAccess::requestStorageAccessQuirk):
* Source/WebCore/dom/DocumentStorageAccess.h:
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::requestStorageAccess):
* Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
* Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h:
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestStorageAccess):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestStorageAccess):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
Originally-landed-as: 305413.854@safari-7624-branch (6fae18f756d2). rdar://180436613
Canonical link: https://commits.webkit.org/316120@main
* MockSampleBox should not have negative timeScales and duration
rdar://174740124
https://bugs.webkit.org/show_bug.cgi?id=313917
Reviewed by Simon Fraser.
* Source/WebCore/platform/mock/mediasource/MockBox.cpp:
(WebCore::MockInitializationBox::MockInitializationBox):
(WebCore::MockSampleBox::MockSampleBox):
Originally-landed-as: 305413.813@safari-7624-branch (4f7a3cfefe44). rdar://180437504
Canonical link: https://commits.webkit.org/316121@main
* [cleanup] Rename RenderBox::setWidth()/setHeight() to setBorderBoxWidth()/setBorderBoxHeight()
https://bugs.webkit.org/show_bug.cgi?id=318039
<rdar://problem/180975454>
Reviewed by Antti Koivisto.
Follow-up to the width()/height() -> borderBoxWidth()/borderBoxHeight() rename.
setWidth()/setHeight() set the border box width/height, but the bare names
didn't say so -- the unqualified odd ones out next to setBorderBoxSize() and the
borderBox* getters. Name them for what they are.
Mechanical rename across WebCore; no behavior change.
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(FlexLayout::layout):
(FlexLayout::updateRenderers):
* Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp:
(GridLayout::updateGridItemRenderers):
(GridLayout::updateFormattingContextRootRenderer):
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderBoxInlines.h:
(RenderBox::setLogicalHeight):
(RenderBox::setLogicalWidth):
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(RenderDeprecatedFlexibleBox::layoutBlock):
(RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(RenderDeprecatedFlexibleBox::layoutSingleClampedFlexItem):
(RenderDeprecatedFlexibleBox::layoutVerticalBox):
* Source/WebCore/rendering/RenderFrameSet.cpp:
(RenderFrameSet::layout):
(resetFrameRendererAndDescendants):
(RenderFrameSet::positionFrames):
* Source/WebCore/rendering/RenderListMarker.cpp:
(RenderListMarker::layout):
* Source/WebCore/rendering/RenderReplaced.cpp:
(RenderReplaced::layout):
* Source/WebCore/rendering/RenderScrollbarPart.cpp:
(RenderScrollbarPart::layoutHorizontalPart):
(RenderScrollbarPart::layoutVerticalPart):
(RenderScrollbarPart::computeScrollbarWidth):
(RenderScrollbarPart::computeScrollbarHeight):
(RenderScrollbarPart::paintIntoRect):
* Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:
(RenderSVGForeignObject::updateLogicalWidth):
Canonical link: https://commits.webkit.org/316122@main
* [cleanup] Use RenderBox::borderBoxSize() in size-only callers of borderBoxRect()
https://bugs.webkit.org/show_bug.cgi?id=318020
Reviewed by Antti Koivisto.
These call sites only read the size of borderBoxRect(); none of them use its
location. borderBoxRect() is { 0, 0, borderBoxSize() }, so constructing the
positioned rect just to call .size()/.width()/.height()/.isEmpty() is wasteful
and hides the intent. Use the direct accessor (borderBoxSize(), borderBoxWidth(),
borderBoxHeight()) instead. No behavior change.
* Source/WebCore/rendering/RenderBox.cpp:
(RenderBox::reflectionOffset):
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(RenderSVGRoot::paint):
(RenderSVGRoot::boundingRects):
* Source/WebCore/style/values/transforms/StyleTransformList.cpp:
(Blending<TransformList>::blend):
Canonical link: https://commits.webkit.org/316123@main
* Use-after-free under WebsiteDataStore::beginAppBoundDomainCheck()
https://bugs.webkit.org/show_bug.cgi?id=314295
rdar://176438133
Reviewed by Ryosuke Niwa.
Stop capturing `host` and `protocol` by reference in the lambda since
the lambda can get called asynchronously.
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
Originally-landed-as: 305413.851@safari-7624-branch (3602ee8745a7). rdar://180438476
Canonical link: https://commits.webkit.org/316124@main
* WebGL: Uninitialized FastMalloc heap disclosure in RemoteGraphicsContextGL::readPixelsInline
https://bugs.webkit.org/show_bug.cgi?id=312564
rdar://174640403
Reviewed by Dan Glastonbury.
Allocate the read pixels area with zero init.
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::readPixelsInline):
Originally-landed-as: 305413.708@safari-7624-branch (0c204da15932). rdar://180438472
Canonical link: https://commits.webkit.org/316125@main
* FilterImage may return uninitialized PixelBuffer
https://bugs.webkit.org/show_bug.cgi?id=314906
rdar://176813834
Reviewed by Darin Adler.
FilterImage provides three different representations of the image: ImageBuffer,
Unpremultiplied PixelBuffer and Premultiplied PixelBuffer. These three buffers
are lazily created. Each of them is created only when it is needed. But keep in
mind they are copies of each other. In other words, when one is created it has
to copy the pixels from the existing buffers. Otherwise it has to be zero-filled.
A problem may happen when copying the pixels from one buffer to a newly created
buffer fails. In this case we send uninitialized PixelBuffer which may expose user
private data. Not able to copy existing pixels to the PixelBuffer should be treated
as an error. So a null PixelBuffer should be returned in this case.
* Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNeonApplier.cpp:
(WebCore::FEBlendNeonApplier::apply const):
* Source/WebCore/platform/graphics/filters/FilterImage.cpp:
(WebCore::copyImageBytes):
(WebCore::FilterImage::pixelBuffer):
(WebCore::FilterImage::getPixelBuffer):
(WebCore::FilterImage::copyPixelBuffer):
* Source/WebCore/platform/graphics/filters/FilterImage.h:
Originally-landed-as: 305413.919@safari-7624-branch (dbf10417aa9e). rdar://180436188
Canonical link: https://commits.webkit.org/316126@main
* YarrJIT negativeOffsetIndexedAddress discards adjusted base register
https://bugs.webkit.org/show_bug.cgi?id=312415
rdar://174714198
Reviewed by Yijia Huang.
In YarrJIT negativeOffsetIndexedAddress computes a negative offset from
a base address but the function mistakenly uses the original value
instead of the adjusted value. This patch fixes it to use the adjusted
value.
Test: JSTests/stress/yarr-negative-offset.js
* JSTests/stress/yarr-negative-offset.js: Added.
(catch):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
Originally-landed-as: 305413.685@safari-7624-branch (30c8460241f3). rdar://180436598
Canonical link: https://commits.webkit.org/316127@main
* [JSC] Spread operator doesn't account for cellButterflyOnlyAtomStringsStructure in DFG
https://bugs.webkit.org/show_bug.cgi?id=313252
rdar://175498631
Reviewed by Yijia Huang.
This patch fixes the abstract interpreter's structure prediction for the spread operator.
Instead of only cellButterflyStructure(CopyOnWriteArrayWithContiguous), it now also takes
cellButterflyOnlyAtomStringsStructure into account.
Test: JSTests/stress/spread-with-OnlyAtomStringsStructure.js
* JSTests/stress/spread-with-OnlyAtomStringsStructure.js: Added.
(index):
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
Originally-landed-as: 305413.768@safari-7624-branch (62a1052dd1fe). rdar://180435430
Canonical link: https://commits.webkit.org/316128@main
* [CoreIPC] [NP] Heap UAF in WebCore::IDBServer::MemoryIndexCursor reverse iterator when a Prev/Prevunique cursor's next-higher index entry is deleted
<https://bugs.webkit.org/show_bug.cgi?id=313818>
<rdar://174678764>
Reviewed by Sihui Liu.
MemoryIndexCursor caches an IndexValueStore::Iterator across IPC messages.
For Prev/Prevunique cursors this wraps std::set<IDBKeyData>::reverse_iterator
objects (one for the outer IndexValueStore::m_orderedKeys set, one nested in
IndexValueEntry::Iterator for the inner per-index-key set). A
std::reverse_iterator stores a forward base() iterator pointing one element
past the logical position; for libc++ std::set that is a raw __tree_node*.
MemoryIndexCursor::indexValueChanged() only invalidates m_currentIterator
when the changed (key, primaryKey) equals the cursor's current logical
position. Deleting the next-higher index key (Variant A, outer set) or the
next-higher primary key under a shared index key (Variant B, inner set)
therefore frees exactly the __tree_node base() references while the guard
early-returns. The next IterateCursor IPC executes ++m_reverseIterator =>
--base() => __tree_prev_iter(freed_node), a heap-use-after-free in
com.apple.WebKit.Networking reachable from a compromised WebContent process
via NetworkStorageManager IPC with WCP-controlled
IDBDatabaseIdentifier.m_isTransient = true forcing MemoryIDBBackingStore.
Fix by gating the equality early-return on info().isDirectionForward(). For
reverse cursors we now invalidate m_currentIterator on any index mutation;
iterate() already re-seeks via reverseFind(m_currentKey, m_currentPrimaryKey)
when the iterator is invalid. Both removeEntriesWithValueKey() erase paths
(outer m_orderedKeys.erase() and inner IndexValueEntry::removeKey()) reach
indexValueChanged() through MemoryIndex::notifyCursorsOfValueChange(), so
both variants are closed.
* LayoutTests/storage/indexeddb/index-cursor-reverse-delete-next-higher-key-private-expected.txt: Added.
* LayoutTests/storage/indexeddb/index-cursor-reverse-delete-next-higher-key-private.html: Added.
* Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::indexValueChanged):
Originally-landed-as: 305413.842@safari-7624-branch (d14d12e915f3). rdar://180436983
Canonical link: https://commits.webkit.org/316129@main
* ANGLE: Metal: Inconsistent implementation of various DrawElements variations
https://bugs.webkit.org/show_bug.cgi?id=312470
rdar://174919762
Reviewed by Dan Glastonbury.
The implementation of DrawElements would be inconsistent:
The implementation has multiple stages of possible intermediate buffers.
At various stages, offsets and counts were mixed between incorrect
stages.
Historically the confusions were partly due to the logic loading
the primitive ranges sometimes from generate intermediary buffers,
sometimes from the original client-provided buffer. This was partly
fixed to load only from client-provided buffers and client arrays
in "WebGL: consecutive UNSIGNED_BYTE drawElements() draw in wrong
location", but this caused a regression by other part of the code
using counts from incorrect stages.
The implementation strategy would not working for non-strip topologies,
such as GL_TRIANGLES, in primitive restart cases when provoking vertex
rewrite was needed. The provoking vertex rewrite operates per primitive.
For strip topologies, this works as each vertex index also defines a
primitive. For non-strip topologies, this is not possible as the
provoking vertex generation shader cannot know where the primitive
starts. Example: GL_TRIANGLES of {0, ff, 1, 2, 3, 4} would be dispatched
as primitives starting at 0 and 2, but the proper dispatch list
would contain just primitive at 1.
Furthermore, the logic to determine drawn index ranges was based on
scanning for primitive restart ranges, and then converting those
to draw index ranges. This algorithm was brittle and contained
quite many confusions.
Fix by:
- Resolve the draw index ranges by resolving the draw index ranges
instead of restart ranges. These index ranges are then intersected
with the client provided offset and count, which define the first
index, last index range pair.
- Consistently resolve the draw index ranges ƒrom the client buffers.
- Keep all intermediate buffers consistent with the first index, count:
the intermediate buffers always have the similar unused prefix
than the original client-provided index buffer.
- Keep all the intermediate buffers offsets separated from the
client-provided offset (first index). The intermediate buffers are
allocated from the buffer pool, so they're not separate buffers but
buffer, offset pairs. Keep these buffer, offset pairs separate from
the client first index
- For non-strip topology draws, provide the draw ranges already to the
provoking vertex shader helper. The provoking vertex shader is
only run for the real draw indices instead of the full draw.
This allows the shader to function correctly.
* Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/BufferMtl.h:
(rx::DrawIndexRange::DrawIndexRange):
(rx::BufferMtl::DrawIndexRangeCache::DrawIndexRangeCache):
(rx::IndexRange::IndexRange): Deleted.
(rx::BufferMtl::RestartRangeCache::RestartRangeCache): Deleted.
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/BufferMtl.mm:
(rx::BufferMtl::markConversionBuffersDirty):
(rx::BufferMtl::clearConversionBuffers):
(rx::CalculateDrawIndexRanges):
(rx::BufferMtl::getDrawIndexRanges):
(rx::BufferMtl::GetDrawIndexRangesFromClientData):
(rx::IndexConversionBufferMtl::getRangeForConvertedBuffer): Deleted.
(rx::CalculateRestartRanges): Deleted.
(rx::BufferMtl::getRestartIndices): Deleted.
(rx::BufferMtl::GetRestartIndicesFromClientData): Deleted.
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.h:
(rx::ContextMtl::getProvokingVertexHelper):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.mm:
(rx::ContextMtl::drawElementsImpl):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProvokingVertexHelper.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ProvokingVertexHelper.mm:
(rx::ProvokingVertexHelper::preconditionIndexBuffer):
(rx::ProvokingVertexHelper::generateIndexBuffer):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm:
(rx::AppendDrawCommands):
(rx::AppendDrawCommandRanges):
(rx::VertexArrayMtl::resolveDrawElementsDraw):
(rx::VertexArrayMtl::getIndexBuffer): Deleted.
(rx::VertexArrayMtl::getDrawIndices): Deleted.
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl_unittest.mm: Added.
* Source/ThirdParty/ANGLE/src/tests/gl_tests/DrawElementsTest.cpp:
(angle::convertIndexBufferContents):
Originally-landed-as: 305413.713@safari-7624-branch (23eba5e02916). rdar://180437073
Canonical link: https://commits.webkit.org/316130@main
* [WebGPU] signed-negation overflow on baseVertex==INT32_MIN in RenderPassEncoder::clampIndexBufferToValidValues
https://bugs.webkit.org/show_bug.cgi?id=315196
rdar://176882934
Reviewed by Mike Wyrzykowski.
RenderPassEncoder::clampIndexBufferToValidValues guards baseVertex magnitude with
-baseVertex > static_cast<int64_t>(minVertexCount), but the unary negation runs
in 32-bit signed arithmetic before the comparison widens, so baseVertex == INT32_MIN
wraps to itself and passes the guard. The fix widens baseVertex to int64_t before
negation and sign extension preserves all valid negative baseVertex values, so the
guard's behaviour is unchanged for every input except INT32_MIN, whose magnitude (2^31)
is now representable and correctly rejected.
Test: fast/webgpu/nocrash/fuzz-176882934.html
* LayoutTests/fast/webgpu/nocrash/fuzz-176882934-expected.txt: Added.
* LayoutTests/fast/webgpu/nocrash/fuzz-176882934.html: Added.
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::clampIndexBufferToValidValues):
Originally-landed-as: 305413.952@safari-7624-branch (04553772a362). rdar://180436823
Canonical link: https://commits.webkit.org/316131@main
* [JSC] Unconditionally keep OMGOSREntryCallee alive while updating its callsites
https://bugs.webkit.org/show_bug.cgi?id=313063
rdar://174492346
Reviewed by Keith Miller.
After a re-tier, when a fresh BBQCallee replaces a retired one,
m_osrEntryCallees may hold a stale weak ref to an OMGOSREntryCallee not owned
by the current BBQCallee. Currently, updateCallsitesToCallUs will not track
this since it assumes that this OMGOSREntryCallee will be owned by the BBQCallee
This patch fixes it by unconditionally keeping the OMGOSREntryCallee alive
while we update all the callsites within it. The assert in ~BBQCallee is void
now since an OMGOSREntryCallee can now have multiple owners.
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::BBQCallee::~BBQCallee):
* Source/JavaScriptCore/wasm/WasmCalleeGroup.cpp:
(JSC::Wasm::CalleeGroup::updateCallsitesToCallUs):
Originally-landed-as: 305413.784@safari-7624-branch (84a5f91f00a5). rdar://180437899
Canonical link: https://commits.webkit.org/316132@main
* Reject IndexedDB transactions during version change operation
https://bugs.webkit.org/show_bug.cgi?id=312391
rdar://173799670
Reviewed by Sihui Liu.
When an IndexedDB connection is closed while a version
change transaction is active, UniqueIDBDatabase::connectionClosedFromClient
successfully closes the version change transaction however it does
not clear any other pending transactions due to an early return
when clearing version change transactions.
Instead of being defensive and clearing the pending transaciton
in the case of the early return, we should reject any incoming
transactions which come on a version change connection.
Only whenever a version change operation completes, can
a new transaction be established. So, this patch rejects any
incoming transactions which come while a version change operation
is active.
The IndexedDB spec describes the steps for starting a new transaction:
The transaction(storeNames, mode, options) method steps are:
1. If a live upgrade transaction is associated with the connection, throw an "InvalidStateError" DOMException.
https://w3c.github.io/IndexedDB/#dom-idbdatabase-transaction
This check already happens in the web process during
IDBDatabase::transaction where it returns an "InvalidStateError"
in this state.
However, this doesn't account for a compromised web process
who avoids this client side check and makes it across IPC
to invoke transaction creation in the NetworkProcess.
This patch adds a check for this scenario of a comprimised web
process who manages to start a new transaction during a
version change, if this is detected, we return early and
don't move forward with creating the transaction
This patch checks that the current connection isn't the
stored UniqueIDBDatabase::m_versionChangeDatabaseConnection.
That member variable will point to the active version change connection,
if any, and it is cleared when the version change completes.
It also checks if m_versionChangeTransaction is non-null
since it will only be null once the version change transaction
is completed.
* LayoutTests/ipc/networksindexeddb-close-connection-during-version-change-expected.txt: Added.
* LayoutTests/ipc/networksindexeddb-close-connection-during-version-change.html: Added.
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::isVersionChangeTransactionActive const):
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h:
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::NetworkStorageManager::establishTransaction):
(WebKit::NetworkStorageManager::databaseConnectionPendingClose):
Originally-landed-as: 305413.734@safari-7624-branch (6b2393e40648). rdar://180437837
Canonical link: https://commits.webkit.org/316133@main
* [WebGPU] Stale WeakPtr comparison in BindGroupLayout::errorValidatingBindGroupCompatibility allows incompatible auto/explicit layout pairing
https://bugs.webkit.org/show_bug.cgi?id=315496
rdar://176812014
Reviewed by Mike Wyrzykowski.
We were using weak pointers to compare the autogenerated pipeline layouts when
checking for compatibility of two bind groups, however the weak pointer can be
null in two scenarios: when the layout is explicit or when the pipeline layout
has been destroyed. That could result in incorrectly considering two bind groups
compatible when one is pipeline layout is explicit and the other has been destroyed.
In order to avoid that we explicitly check whether both bind groups use auto
generated layouts.
Test: fast/webgpu/regression/repro_176812014.html
* LayoutTests/fast/webgpu/regression/repro_176812014-expected.txt: Added.
* LayoutTests/fast/webgpu/regression/repro_176812014.html: Added.
* Source/WebGPU/WebGPU/BindGroupLayout.mm:
(WebGPU::BindGroupLayout::errorValidatingBindGroupCompatibility const):
Originally-landed-as: 305413.964@safari-7624-branch (48e38ee5acbc). rdar://180428905
Canonical link: https://commits.webkit.org/316134@main
* use-after-free in WebCodecsAudioData::memoryCost() via concurrent GC marker / close()
rdar://175520011
Reviewed by Jean-Yves Avenard
WebCodecsAudioData is annotated with ReportExtraMemoryCost, so the generated
JS wrapper's visitChildren calls WebCodecsAudioData::memoryCost() from a
concurrent GC marker thread. memoryCost() dereferenced m_data.audioData (a
RefPtr<PlatformRawAudioData>) without synchronization while close() on the
main thread assigns m_data.audioData = nullptr and frees the
PlatformRawAudioData, leading to a heap-use-after-free in
PlatformRawAudioDataCocoa::memoryCost().
Cache the memory cost in a std::atomic<size_t> on WebCodecsAudioData,
computed once at construction time on the main thread and zeroed in close(),
so the GC-thread memoryCost() never touches the RefPtr. This matches the
existing pattern in ImageBitmap.
* LayoutTests/fast/webcodecs/audio-data-close-during-gc-crash-expected.txt: Added.
* LayoutTests/fast/webcodecs/audio-data-close-during-gc-crash.html: Added.
* Source/WebCore/Modules/webcodecs/WebCodecsAudioData.cpp:
(WebCore::WebCodecsAudioData::WebCodecsAudioData):
(WebCore::WebCodecsAudioData::close):
* Source/WebCore/Modules/webcodecs/WebCodecsAudioData.h:
(WebCore::WebCodecsAudioData::memoryCost const):
Originally-landed-as: 305413.845@safari-7624-branch (2102c1dad1d3). rdar://180438342
Canonical link: https://commits.webkit.org/316135@main
* [WebKit Process Model] Use-after-free in WebExtensionContext::storageSet from HashMap mutation during keys() iteration
https://bugs.webkit.org/show_bug.cgi?id=315538
rdar://177375129
Reviewed by Timothy Hatcher.
When WebExtensionStorageSQLiteStore::setKeyedData hits an INSERT error
mid-batch (e.g. SQLITE_FULL), it returns a keysSuccessfullySet vector
that is non-empty but smaller than the input map. The completion lambda
in storageSet then iterated `data.keys()` while calling `data.remove()`
inside the loop. `keys()` returns a live iterator range backed by raw
pointers into the HashTable buffer, and remove() can shrink/rehash and
free that buffer, leaving the iterator dangling — a heap UAF in the UI
Process driven by IPC from the WebContent process.
Replace the iterate-and-mutate loop with HashMap::removeIf, which walks
the table safely.
* Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIStorage.cpp:
(WebKit::WebExtensionContext::storageSet):
Originally-landed-as: 305413.961@safari-7624-branch (de9fb008197a). rdar://180427449
Canonical link: https://commits.webkit.org/316136@main
* [JSC] TypedArray.from() Out-of-Bounds Read via Resizable ArrayBuffer resize/transfer in mapFn callback.
https://bugs.webkit.org/show_bug.cgi?id=312513
rdar://174428778
Reviewed by Yusuke Suzuki.
Adjusts TypedArray.from to properly handle cases where the map function changes the bounds of the arraylike input.
Test: JSTests/stress/typedarray-from-oob.js
* JSTests/stress/typedarray-from-oob.js: Added.
(testResize):
(testDetach):
* Source/JavaScriptCore/builtins/TypedArrayConstructor.js:
(from):
Originally-landed-as: 305413.702@safari-7624-branch (e99a325bb9b8). rdar://180429231
Canonical link: https://commits.webkit.org/316137@main
* Fix animateMotion-spline-invalid-keyTimes.html
https://bugs.webkit.org/show_bug.cgi?id=318132
Reviewed by Nikolas Zimmermann.
Fix animateMotion-spline-invalid-keyTimes.html by keeping the animation invalid when keyTimes list does not end with 1
for the spline calcMode [1].
[1] https://svgwg.org/specs/animations/#KeyTimesAttribute
* LayoutTests/imported/w3c/web-platform-tests/svg/animations/animateMotion-spline-invalid-keyTimes-expected.txt:
* Source/WebCore/svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::startedActiveInterval):
Canonical link: https://commits.webkit.org/316138@main
* [JSC] Insert barrier for MultiPutByOffset when it can reallocate storage
https://bugs.webkit.org/show_bug.cgi?id=314747
rdar://176792407
Reviewed by Keith Miller.
The DFG barrier insertion phase works by tracking an "epoch" serial number,
which is bumped every time it encounters a node that can GC. The assumption is
that each DFG node either does a store, which would need to be considered for
barrier insertion, or performs a GC.
MultiPutByOffset is a "fat" node that can GC and perform a store after that GC,
in sequence. The current analysis therefore incorrectly elides the barrier for
it. This PR fixes by special casing.
Test: JSTests/stress/multi-put-by-offset-reallocating-storage-needs-write-barrier.js
* JSTests/stress/multi-put-by-offset-reallocating-storage-needs-write-barrier.js: Added.
(foo):
* Source/JavaScriptCore/dfg/DFGStoreBarrierInsertionPhase.cpp:
Originally-landed-as: 305413.909@safari-7624-branch (2b4933eb1658). rdar://180427769
Canonical link: https://commits.webkit.org/316139@main
* REGRESSION(316095@main): error: initializer 'init(_:)' is not available due to missing import of defining module 'WebCore_Private' [#MemberImportVisibility]
https://bugs.webkit.org/show_bug.cgi?id=318219
rdar://181020438
Unreviewed build fix.
* Source/WebKit/UIProcess/mac/WKAppKitGestureController.swift:
Canonical link: https://commits.webkit.org/316140@main
* [LBSE] Rebaseline iOS specific results after 315674@main
https://bugs.webkit.org/show_bug.cgi?id=318220
Unreviewed gardening.
Forgot to reset LBSE specific results after 315674@main, fix that.
* LayoutTests/platform/ios/svg/compositing/anonymous-RenderSVGViewportContainer-no-repaints-expected.txt:
* LayoutTests/platform/ios/svg/compositing/segment-removed-after-anchor-decomposited-layer-tree-expected.txt: Added.
* LayoutTests/platform/ios/svg/compositing/transform-change-repainting-viewBox-repaintRects-expected.txt: Added.
* LayoutTests/platform/ios/svg/transforms/nested-svg-transform-attribute-creates-layer-expected.txt: Added.
Canonical link: https://commits.webkit.org/316141@main
* [JSC] Add ArrayStorage + GetByVal specific operation
https://bugs.webkit.org/show_bug.cgi?id=318180
rdar://180990441
Reviewed by Tadeu Zagallo.
This patch adds operationGetByValArrayStorageInt, which is tailored for
ArrayStorage slow path operation. DFG / FTL can use this when we already
speculate ArrayStorage, but it is a slow path.
ToT Patched
get-by-val-array-storage-sparse-hole 122.9244+-1.1533 ^ 62.5947+-9.6089 ^ definitely 1.9638x faster
get-by-val-array-storage-sparse 117.8623+-0.4612 ^ 84.7042+-0.5769 ^ definitely 1.3915x faster
Tests: JSTests/microbenchmarks/get-by-val-array-storage-sparse-hole.js
JSTests/microbenchmarks/get-by-val-array-storage-sparse.js
* JSTests/microbenchmarks/get-by-val-array-storage-sparse-hole.js: Added.
(get array):
* JSTests/microbenchmarks/get-by-val-array-storage-sparse.js: Added.
(get array):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::getByValArrayStorageInt):
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByVal):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByVal):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByValImpl):
Canonical link: https://commits.webkit.org/316142@main
* Need a process-specific `WebBackForwardListItem::allItems()` instead of the process-global map for better message checking
rdar://174702519
Reviewed by Ben Nham.
When considering whether a given web process should have access to a given back/forward entry,
the global map is the wrong tool.
Check on a per-process basis instead.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm
* Source/WebKit/UIProcess/WebBackForwardList.cpp:
(WebKit::messageCheckItemURLs):
(WebKit::WebBackForwardList::backForwardAddItemShared):
(WebKit::WebBackForwardList::backForwardSetChildItem):
(WebKit::WebBackForwardList::backForwardUpdateItem):
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
* Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm:
(<script>):
(ForgedFileURLItemIsRejected)):
Originally-landed-as: 305413.831@safari-7624-branch (249edf86a9f5). rdar://180428225
Canonical link: https://commits.webkit.org/316143@main
* Combining marks on SVG <textPath> render as dotted circles
https://bugs.webkit.org/show_bug.cgi?id=266832
rdar://120284006
Reviewed by Elika Etemad.
SVG text on a path (and any per-character-positioned text) was laid out one
Unicode code point at a time: SVGTextLayoutEngine opened a fresh
single-code-point fragment for every code point whenever a per-character
condition fired (text on a path, an explicit rotate, vertical text, …),
and SVGTextBoxPainter then shaped each fragment's substring in isolation. A lone
combining mark shaped on its own (e.g. U+0301, or the Devanagari virama U+094D)
makes the font emit a dotted circle.
SVG 2 section 11 addresses the text-positioning attributes (x/y/dx/dy/rotate)
per Unicode code point, but it also defines a "typographic character"
a UAX #29 grapheme cluster such as a base letter plus its
combining marks, or a Devanagari syllable
as an indivisible unit whose internal glyph arrangement is "not user
controllable". So code points are addressed, but typographic characters
are positioned and shaped. WebKit placed code points.
Compute grapheme-cluster boundaries over the renderer text with an ICU
character-break iterator, keyed by the same code-unit offset the layout loop
walks, and only let a cluster-start code point open a new fragment. A
continuation code point (a combining mark, a Devanagari continuation, the
second regional indicator of a flag) now joins the current fragment, so the
painter hands base + marks to the shaper together. This is font-independent, so
it groups base + mark even when the font has no composed glyph -- precisely the
dotted-circle case. Per-code-point metrics, character-data lookups, and the
getNumberOfChars / query contract are unchanged; the fragment simply spans
multiple metrics entries, which recordTextFragment already sums.
Matches Gecko and Blink, which both treat the typographic character as the
positioning unit. For pure ASCII / precomposed Latin-1 text every code point is
a grapheme boundary, so behavior is unchanged there.
Tests: imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-ref.html
imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks.html
* LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks.html: Added.
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
Canonical link: https://commits.webkit.org/316144@main
* [macOS] Scroll pocket color may be lost in fullscreen after refresh
https://bugs.webkit.org/show_bug.cgi?id=317824
rdar://179516708
Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.
In Safari, if the option to automatically hide the toolbar in fullscreen
is enabled, the top obscured content inset becomes zero while the toolbar
is hidden.
In WebPage::sidesRequiringFixedContainerEdges(), we skip the top edge
if the top obscured content inset is zero. This means that, if a user
is in fullscreen with the toolbar hidden, navigates to a website with
a fixed top header, scrolls down, and then reveals the toolbar, the
scroll pocket color will not match the header.
To fix this, we add an aditional case where we add the top edge:
when the window is in fullscreen, and the toolbar overlay height
is greater than zero.
Tested by new `ObscuredContentInsets` API tests
`ScrollPocketCoversFullScreenTitlebarAfterReload`
and `ScrollPocketCoversFullScreenTitlebarAfterMovingIntoFullScreenWindow`.
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setWindowIsInNativeFullScreen):
(WebKit::WebPageProxy::setFullScreenTitlebarOverlayIsRevealed):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(-[WKWindowVisibilityObserver startObserving:]):
(-[WKWindowVisibilityObserver _windowDidEnterFullScreen:]):
(-[WKWindowVisibilityObserver _windowDidExitFullScreen:]):
(WebKit::WebViewImpl::windowDidEnterOrExitFullScreen):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::setFullScreenTitlebarOverlayHeight):
(-[WKWindowVisibilityObserver _windowDidEnterOrExitFullScreen:]): Deleted.
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::sidesRequiringFixedContainerEdges const):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ObscuredContentInsets.mm:
(TestWebKitAPI::TEST(ObscuredContentInsets, ScrollPocketCoversFullScreenTitlebar)):
(TestWebKitAPI::createFullScreenCapableWindow):
(TestWebKitAPI::TEST(ObscuredContentInsets, ScrollPocketCoversFullScreenTitlebarAfterReload)):
(TestWebKitAPI::TEST(ObscuredContentInsets, ScrollPocketCoversFullScreenTitlebarAfterMovingIntoFullScreenWindow)):
Canonical link: https://commits.webkit.org/316145@main
* [MSE] Loosen gap tolerance during playback and seek
https://bugs.webkit.org/show_bug.cgi?id=317681
rdar://180439090
Reviewed by Jer Noble.
MediaSourcePrivate now owns a single gap policy consulted at every
buffered-range boundary. Three tolerances replace the prior fixed
timeFudgeFactor:
- Start-of-stream allowance: 1s. Per MSE 2 §presentation-start-time:
"implementations MAY choose to allow a current playback position at
or after presentation start time and before the first TimeRanges to
play the first TimeRanges if that TimeRanges starts within a
reasonably short time, like 1 second, after presentation start time".
Applied only when time is before ranges.start(0). HTMLMediaElement.
buffered reported to JS is unchanged.
- Mid-stream gap tolerance: 125 ms. Default tolerance for gaps between
buffered sub-ranges.
- Audio-covered gap tolerance: 250 ms. Widened tolerance when an active
audio track covers the gap position (typical video-only gap with
audio continuous through it).
setTimeFudgeFactor IPC and MediaSource::currentTimeFudgeFactor removed.
* LayoutTests/media/media-source/media-source-fudge-factor-expected.txt: Removed.
* LayoutTests/media/media-source/media-source-fudge-factor.html: Removed.
* LayoutTests/media/media-source/media-source-gap-policy-expected.txt: Added.
* LayoutTests/media/media-source/media-source-gap-policy.html: Added.
* LayoutTests/media/media-source/media-source-video-renders.html:
* Source/WebCore/Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setPrivateAndOpen):
(WebCore::MediaSource::currentTimeFudgeFactor): Deleted.
* Source/WebCore/Modules/mediasource/MediaSource.h:
* Source/WebCore/platform/graphics/MediaSourcePrivate.cpp:
(WebCore::MediaSourcePrivate::hasFutureTime const):
(WebCore::MediaSourcePrivate::hasBufferedTime const):
(WebCore::MediaSourcePrivate::hasCurrentTime const):
(WebCore::MediaSourcePrivate::isBuffered const):
(WebCore::MediaSourcePrivate::cancelPendingWaitForTarget):
(WebCore::MediaSourcePrivate::updateBufferedRanges):
(WebCore::MediaSourcePrivate::nextStallTime const):
(WebCore::MediaSourcePrivate::gapToleranceAtTime const): returns the applicable tolerance for time,
consulted by hasFutureTime, hasBufferedTime, isBuffered, nextStallTime,
canCompleteWaitForTarget, and TrackBuffer's enqueue gap check.
(WebCore::MediaSourcePrivate::isWithinStartGapAllowance const):
* Source/WebCore/platform/graphics/MediaSourcePrivate.h:
* Source/WebCore/platform/graphics/PlatformTimeRanges.cpp:
(WebCore::PlatformTimeRanges::containWithEpsilon const): overload so
that isBuffered can apply a per-position tolerance at each gap.
* Source/WebCore/platform/graphics/PlatformTimeRanges.h:
* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::reenqueueMediaForTime):
(WebCore::SourceBufferPrivate::addTrackBuffer):
(WebCore::SourceBufferPrivate::isAudioBufferedAt const):
(WebCore::SourceBufferPrivate::audioBufferedRanges const):
* Source/WebCore/platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::timeFudgeFactor const): Deleted.
* Source/WebCore/platform/graphics/TrackBuffer.cpp:
(WebCore::TrackBuffer::create):
(WebCore::TrackBuffer::TrackBuffer):
(WebCore::TrackBuffer::isAcceptableEnqueueGap const):
(WebCore::TrackBuffer::nextSample):
(WebCore::TrackBuffer::reenqueueMediaForTime):
* Source/WebCore/platform/graphics/TrackBuffer.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::resetStallForTime): Move nextStallTime(time)
logic to MediaSourcePrivate.
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::timeFudgeFactor const): Deleted.
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::reenqueueMediaForTime):
(WebCore::MediaPlayerPrivateWebM::addTrackBuffer):
(WebCore::MediaPlayerPrivateWebM::monitorReadyState):
* Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.cpp:
(WebKit::RemoteMediaSourceProxy::setTimeFudgeFactor): Deleted.
* Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.h:
* Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.messages.in:
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::currentTimeWithLockHeld const):
* Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:
(WebKit::MediaSourcePrivateRemote::setTimeFudgeFactor): Deleted.
* Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.h:
Canonical link: https://commits.webkit.org/316146@main
* [cleanup] Use RenderBox::borderBoxSize() in size-only callers of frameRect()
https://bugs.webkit.org/show_bug.cgi?id=318045
Reviewed by Antti Koivisto.
Follow-up to 318020, which swept the size-only callers of borderBoxRect() but
not the frameRect().size() spelling of the same thing. These RenderTableCell
paint helpers only want the border box size, and frameRect().size() is exactly
borderBoxSize() (both are m_frameRect.size()), so use the direct accessor. No
behavior change.
* Source/WebCore/rendering/RenderTableCell.cpp:
(RenderTableCell::paintCollapsedBorders):
(RenderTableCell::paintBoxDecorations):
(RenderTableCell::paintMask):
Canonical link: https://commits.webkit.org/316147@main
* Add findIfCached / insert to TinyLRUCache
https://bugs.webkit.org/show_bug.cgi?id=314417
Reviewed by Keith Miller.
This is useful for cases when you need to cache something that can't
created statically.
We also add a generated test to gently exercise this new code.
We also add a new safe iterator mechanism to ensure that this new API
can't be used unsafely.
* Source/WTF/wtf/TinyLRUCache.h:
(WTF::TinyLRUCache::~TinyLRUCache):
(WTF::TinyLRUCache::TinyLRUCache):
(WTF::TinyLRUCache::operator=):
(WTF::TinyLRUCache::FindResult::~FindResult):
(WTF::TinyLRUCache::FindResult::operator bool const):
(WTF::TinyLRUCache::FindResult::operator* const):
(WTF::TinyLRUCache::FindResult::operator-> const):
(WTF::TinyLRUCache::FindResult::FindResult):
(WTF::TinyLRUCache::FindResult::assertValid const):
(WTF::TinyLRUCache::get):
(WTF::TinyLRUCache::findIfCached):
(WTF::TinyLRUCache::insert):
(WTF::TinyLRUCache::clear):
(WTF::TinyLRUCache::size const):
(WTF::TinyLRUCache::trackFindResult):
(WTF::TinyLRUCache::invalidateIterators):
(WTF::TinyLRUCache::findInternal):
(WTF::TinyLRUCache::insertInternal):
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/Tests/WTF/TinyLRUCache.cpp: Added.
(TestWebKitAPI::CountingPolicy::createValueForKey):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, GetCachesOnHit)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, GetEvictsLRU)):
(TestWebKitAPI::NullKeyPolicy::isKeyNull):
(TestWebKitAPI::NullKeyPolicy::createValueForNullKey):
(TestWebKitAPI::NullKeyPolicy::createValueForKey):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, GetWithNullKeyReturnsNullValueAndDoesNotStore)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindIfCachedReturnsNullOnMiss)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindIfCachedHitsAfterInsert)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, InsertEvictsLRU)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindIfCachedPromotesToMRU)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, ClearReleasesEntriesAndResetsSize)):
(TestWebKitAPI::TrackedRefCounted::create):
(TestWebKitAPI::TrackedRefCounted::value const):
(TestWebKitAPI::TrackedRefCounted::~TrackedRefCounted):
(TestWebKitAPI::TrackedRefCounted::TrackedRefCounted):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, ClearReleasesRefsImmediately)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, EvictionViaInsertReleasesRef)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindIfCachedDoesNotConsumeEntry)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindIfCachedAfterClearMisses)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindOrComputeWorkflow)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, FindResultSafeAfterCacheDestroyed)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, InsertInvalidatesFindResult)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, ClearInvalidatesFindResult)):
(TestWebKitAPI::TEST(WTF_TinyLRUCache, SubsequentFindInvalidatesPriorFindResult)):
(TestWebKitAPI::TEST(WTF_TinyLRUCacheDeathTest, UseAfterInsertDeathTest)):
(TestWebKitAPI::TEST(WTF_TinyLRUCacheDeathTest, UseAfterClearDeathTest)):
(TestWebKitAPI::TEST(WTF_TinyLRUCacheDeathTest, UseAfterSubsequentFindDeathTest)):
Canonical link: https://commits.webkit.org/316148@main
* Validate several ITP and storage access IPC messages
https://bugs.webkit.org/show_bug.cgi?id=312798
rdar://174708437
Reviewed by Matthew Finkel.
ResourceLoadStatisticsUpdated, LogUserInteraction, and RequestStorageAccessUnderOpener accept
WebContent-supplied data with no validation. A WCP can forge storageAccessUnderTopFrameDomains and
isPrevalentResource in the ITP database, then obtain cross-origin cookie access without a user
prompt.
Verify that ResourceLoadStatisticsUpdated only contains fields the WebContent process legitimately
observes, and that LogUserInteraction and RequestStorageAccessUnderOpener are called with domains
the process owns.
Test: ipc/forged-resource-load-statistics-storage-access.html
* LayoutTests/ipc/forged-resource-load-statistics-storage-access-expected.txt: Added.
* LayoutTests/ipc/forged-resource-load-statistics-storage-access.html: Added.
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
(WebKit::resourceLoadStatisticsContainsOnlyObservableFields):
(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
Originally-landed-as: 305413.716@safari-7624-branch (9d8f969c538a). rdar://180428563
Canonical link: https://commits.webkit.org/316149@main
* [WebCore][bindings] Empty JSValue returned to script from callPromisePairFunction when argument conversion throws
https://bugs.webkit.org/show_bug.cgi?id=313618
rdar://175673155
Reviewed by Ryosuke Niwa.
callPromisePairFunction stored the functor's EncodedJSValue and returned it
after passing the catch scope through rejectPromiseWithExceptionIfAny. When the
generated operation body threw during IDL argument conversion, it returned
encodedJSValue() (the empty JSValue sentinel) with a pending exception. The
first rejectPromiseWithExceptionIfAny call cleared that exception to reject the
first promise, so the second call was a no-op — leaving the second promise
unrejected — and RETURN_IF_EXCEPTION did not fire. The empty sentinel was then
returned to JavaScript as a script-visible value.
Fix by:
- Introducing rejectPromisesWithExceptionIfAny, which saves the error value
before clearing the exception and rejects both promises. Shared
takeNonTerminationException helper factors out the check-save-clear logic
from rejectPromiseWithExceptionIfAny.
- Adding a DictionaryType template parameter to callPromisePairFunction. When
the functor returns an empty JSValue (the error-path sentinel),
callPromisePairFunction reconstructs a valid result dictionary from the
rejected promises via convertDictionaryToJS.
- Threading the concrete dictionary type (e.g. Navigation::Result) from the
code generator through callReturningPromisePair to callPromisePairFunction.
Test: navigation-api/navigation-navigate-throwing-argument-conversion.html
* LayoutTests/navigation-api/navigation-navigate-throwing-argument-conversion-expected.txt: Added.
* LayoutTests/navigation-api/navigation-navigate-throwing-argument-conversion.html: Added.
* Source/WebCore/bindings/js/JSDOMOperationReturningPromise.h:
(WebCore::IDLOperationReturningPromise::callReturningPromisePair):
* Source/WebCore/bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::takeNonTerminationException):
(WebCore::rejectPromiseWithExceptionIfAny):
(WebCore::rejectPromisesWithExceptionIfAny):
* Source/WebCore/bindings/js/JSDOMPromiseDeferred.h:
(WebCore::callPromisePairFunction):
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GenerateOperationTrampolineDefinition):
* Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSC_DEFINE_HOST_FUNCTION):
Originally-landed-as: 305413.776@safari-7624-branch (332eff8c4870). rdar://180436895
Canonical link: https://commits.webkit.org/316150@main
* Use-after-free in SVGGeometryElement::getPointAtLength — raw renderer pointer held across nested updateLayout
https://bugs.webkit.org/show_bug.cgi?id=314326
rdar://175670940
Reviewed by Simon Fraser.
Between the call to `updateLayoutIgnorePendingStylesheets()` and the call to
`SVGGeometryElement::getTotalLength()`, `SVGGeometryElement::getPointAtLength()`
caches its renderer() in a raw pointer. The problem is `getTotalLength()` also
calls `updateLayoutIgnorePendingStylesheets()` which may delete the renderer.
This will make `getPointAtLength()` use-after-free the cached raw pointer renderer.
Rearrange the code such that `updateLayoutIgnorePendingStylesheets()` is called
only once per `getPointAtLength()` and read `this->renderer()` exactly before it
is referenced.
* Source/WebCore/svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::calculateTotalLength const):
(WebCore::SVGGeometryElement::getTotalLength const):
(WebCore::SVGGeometryElement::calculatePointAtLength const):
(WebCore::SVGGeometryElement::getPointAtLength const):
* Source/WebCore/svg/SVGGeometryElement.h:
Originally-landed-as: 305413.857@safari-7624-branch (d1e59347508c). rdar://180437982
Canonical link: https://commits.webkit.org/316151@main
* [JSC] Disallow defining private names on WasmGC objects
https://bugs.webkit.org/show_bug.cgi?id=314438
rdar://176445615
Reviewed by Yusuke Suzuki.
While the spec currently technically allows for defining private fields and
methods on WasmGC objects, this is against the spirit of those objects being
fixed-layout.
For compat, both V8 and SpiderMonkey also disallow addition of private names on
WasmGC objects.
Test: JSTests/wasm/gc/private-fields-and-methods.js
* JSTests/wasm/gc/private-fields-and-methods.js: Added.
(testPrivateMethodOnStruct.B):
(testPrivateMethodOnStruct.D.prototype.m):
(testPrivateMethodOnStruct.D):
(testPrivateMethodOnStruct):
(testPrivateFieldOnStruct.B):
(testPrivateFieldOnStruct.D):
(testPrivateFieldOnStruct):
(testPrivateMethodOnArray.B):
(testPrivateMethodOnArray.D.prototype.m):
(testPrivateMethodOnArray.D):
(testPrivateMethodOnArray):
(testPrivateFieldOnArray.B):
(testPrivateFieldOnArray.D):
(testPrivateFieldOnArray):
(testPrivateGetterOnStruct.B):
(testPrivateGetterOnStruct.D.prototype.get x):
(testPrivateGetterOnStruct.D):
(testPrivateGetterOnStruct):
(testGCSurvival.B):
(testGCSurvival.D.prototype.m):
(testGCSurvival.D):
(testGCSurvival):
* Source/JavaScriptCore/runtime/JSObjectInlines.h:
(JSC::JSObject::getPrivateField):
(JSC::JSObject::setPrivateField):
(JSC::JSObject::definePrivateField):
(JSC::JSObject::setPrivateBrand):
Originally-landed-as: 305413.881@safari-7624-branch (525600a227a6). rdar://180438063
Canonical link: https://commits.webkit.org/316152@main
* Uninitialized result of FEGaussianBlur if the input isAlphaImage
https://bugs.webkit.org/show_bug.cgi?id=314345
rdar://175674593
Reviewed by Simon Fraser.
`FEGaussianBlurSoftwareApplier::apply()` creates uninitialized `tempBuffer`
through `createScratchPixelBuffer()`.
-- If the stdDeviation of feGaussianBlur is asymmetric, e.g. "5 0", then applying
this filter falls back to `boxBlurUnaccelerated()`.
-- If the input of feGaussianBlur isAlphaImage, e.g. feColorMatrix(luminanceToAlpha),
then `boxBlur()` short-circuits to `boxBlurAlphaOnly()`, which writes only
the alpha channel of each pixel.
-- If one of the stdDeviation is zero, e.g. "5 0", `boxBlurUnaccelerated()` will
copy the `tempBuffer` to the `destinationPixelBuffer` with three uninitialized
channels before it returns.
If isAlphaImage is true Make sure `tempBuffer` is zero-filled.
* Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:
(WebCore::FEGaussianBlurSoftwareApplier::boxBlurGeneric):
Originally-landed-as: 305413.858@safari-7624-branch (96b0a368415e). rdar://180437556
Canonical link: https://commits.webkit.org/316153@main
* Sort TestWebKitAPI pbxproj file after 316044@main
https://bugs.webkit.org/show_bug.cgi?id=318227
rdar://181029069
Reviewed by Lily Spiniolas.
In this patch, we let Xcode sort the entries in this project file after
the addition of AttributedStringFontCache.mm in 316044@main.
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Canonical link: https://commits.webkit.org/316154@main
* WebGL: GraphicsContextGLANGLE PACK_* state is modifiable through pixelStorei
https://bugs.webkit.org/show_bug.cgi?id=312566
rdar://174740214
Reviewed by Dan Glastonbury.
Filter out pixelStorei parameters.
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::pixelStorei):
Originally-landed-as: 305413.710@safari-7624-branch (dd484347691b). rdar://180435316
Canonical link: https://commits.webkit.org/316155@main
* Marked-text highlight pseudo-element fill color is taken from the stroke color
https://bugs.webkit.org/show_bug.cgi?id=318073
rdar://180871490
Reviewed by Antti Koivisto.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
computeStyleForPseudoElementStyle() set the text fill color from
usedStrokeColor() — a copy/paste from the strokeColor line below it. As a
result, marked text styled via a highlight pseudo-element (::highlight(),
::target-text, ::spelling-error, ::grammar-error) rendered its glyph fill
using the stroke color rather than the text/fill color, and ignored any
applied color filter.
Set fillColor from visitedDependentTextFillColorApplyingColorFilter(),
matching how the fill color is resolved in TextPaintStyle.cpp.
Tests: fast/css/highlight-pseudo-fill-applies-color-filter.html
imported/w3c/web-platform-tests/css/css-pseudo/highlight-fill-color-ignores-stroke-color-ref.html
imported/w3c/web-platform-tests/css/css-pseudo/highlight-fill-color-ignores-stroke-color.html
* LayoutTests/fast/css/highlight-pseudo-fill-applies-color-filter-expected.html: Added.
* LayoutTests/fast/css/highlight-pseudo-fill-applies-color-filter.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-fill-color-ignores-stroke-color-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-fill-color-ignores-stroke-color-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-fill-color-ignores-stroke-color.html: Added.
* Source/WebCore/rendering/StyledMarkedText.cpp:
(WebCore::computeStyleForPseudoElementStyle):
Canonical link: https://commits.webkit.org/316156@main
* Add size limit to Yarr generated code
https://bugs.webkit.org/show_bug.cgi?id=314589
rdar://176137052
Reviewed by Yusuke Suzuki.
Patterns with many sequential non-greedy quantified parenthesized groups
(e.g. (?:a){0,2}? repeated thousands of times) cause O(N^2) code emission
in saveParenContext/restoreParenContext, as each group saves/restores all
frame slots for the entire pattern. This patch adds a code size limit in
VM options above which the code bails out to the interpreter.
Test: JSTests/stress/regexp-many-non-greedy-paren-groups.js
* JSTests/stress/regexp-many-non-greedy-paren-groups.js: Added.
(testLargeNonGreedyParens):
* Source/JavaScriptCore/runtime/OptionsList.h:
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
(JSC::Yarr::dumpCompileFailure):
* Source/JavaScriptCore/yarr/YarrJIT.h:
Originally-landed-as: 305413.923@safari-7624-branch (e6d449d59b50). rdar://180427748
Canonical link: https://commits.webkit.org/316157@main
* DOM XSS in committers-autocomplete.js
https://bugs.webkit.org/show_bug.cgi?id=318161
rdar://180319278
Reviewed by Alexey Proskuryakov.
Construct the autocomplete suggestion menu with createElement and
behavior.
* Websites/bugs.webkit.org/committers-autocomplete.js:
(updateMenu.appendSpan):
(updateMenu):
Canonical link: https://commits.webkit.org/316158@main
* GetPixelBuffer should zeroFill the destination if any error happens
https://bugs.webkit.org/show_bug.cgi?id=312945
rdar://174640273
Reviewed by Kimmo Kinnunen.
RemoteImageBuffer fails to GetPixelBuffer if the destination colorSpace is non-RGB
model (e.g. kCGColorSpaceGenericCMYK). In this case the PixelBuffer is allocated
but never be initialized. So stale heap can be exposed to callers.
To fix this an IPC validator is needed to ensure the colorSpace is indeed RGB model.
And to handle other possible unknown failures, the destination PixelBuffer will
be zero-filled if vImage fails to do the conversion the colorSpace conversion.
* Source/WebCore/platform/graphics/DestinationColorSpace.cpp:
(WebCore::DestinationColorSpace::usesRGBColorModel const):
* Source/WebCore/platform/graphics/DestinationColorSpace.h:
* Source/WebCore/platform/graphics/PixelBufferConversion.cpp:
(WebCore::convertImagePixelsAccelerated):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp:
(TestWebKitAPI::TEST(ImageBufferTests, GetPixelBufferAllZeros)):
Originally-landed-as: 305413.874@safari-7624-branch (8e2784fd0807). rdar://180429216
* Source/WebKit/Shared/WebCoreArgumentCodersPlatform.serialization.in:
Canonical link: https://commits.webkit.org/316159@main
* Lowercase CSP directive names eagerly
https://bugs.webkit.org/show_bug.cgi?id=317730
rdar://180530658
Reviewed by Anne van Kesteren.
Lowercase each CSP directive name as soon as it is read, aligning with the 'Parse a serialized CSP'
section of the CSP Level 3 spec (https://w3c.github.io/webappsec-csp/#parse-serialized-policy).
The case insensitive name comparisons become plain equality checks, and the extra lowercasing in the
reporting path is removed. When an author writes a directive name in some casing other than the spec's
lowercase form, it now behaves like the lowercase form.
Test: http/tests/security/contentSecurityPolicy/directive-name-case-insensitive.html
http/tests/security/contentSecurityPolicy/directive-name-case-insensitive-strict-dynamic.html
* LayoutTests/http/tests/security/contentSecurityPolicy/directive-name-case-insensitive-expected.txt: Added.
* LayoutTests/http/tests/security/contentSecurityPolicy/directive-name-case-insensitive-strict-dynamic-expected.txt: Added.
* LayoutTests/http/tests/security/contentSecurityPolicy/directive-name-case-insensitive-strict-dynamic.html: Added.
* LayoutTests/http/tests/security/contentSecurityPolicy/directive-name-case-insensitive.html: Added.
* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::parse):
(WebCore::ContentSecurityPolicyDirectiveList::parseDirective):
(WebCore::ContentSecurityPolicyDirectiveList::addDirective):
* Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar const):
Canonical link: https://commits.webkit.org/316160@main
* [Site Isolation] Per-frame back/forward walk regresses iframe to stale initial about:blank
https://bugs.webkit.org/show_bug.cgi?id=317458
rdar://180077264
Reviewed by Sihui Liu.
Under UseUIProcessForBackForwardItemLoading, WebPageProxy::dispatchPerFrameTraversals
walks the (current, target) BF frame trees and dispatches a per-frame
GoToBackForwardItem whenever itemSequenceNumber differs. When the target entry
holds the stale "initial about:blank" state for an iframe whose live document has
since loaded a real URL, the walk dispatches a navigation back to about:blank and
regresses the live iframe.
The HTML spec (https://html.spec.whatwg.org/#initialise-the-document-object)
re…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
WTF::Vector<StackFrame>must be moved to a stack copy while it is in use.