VideoFrames cannot be created asynchronously in WebContent process
Component: WebKit GPU Process media | 6d5870d
Source/WebKit/GPUProcess/media/RemoteVideoFrameObjectHeap.cpp
RemoteVideoFrameObjectHeap in the GPU process maps RemoteVideoFrameReference IDs to live VideoFrame objects. WebContent holds RemoteVideoFrameProxy objects naming those frames and sends the references back when it wants to draw, encode or sample them (WebGL, 2D canvas, WebGPU external textures, WebRTC encoders). Previously the GPU process allocated each ID synchronously and returned it in the reply. IDs come from an ObjectIdentifier domain, and a respawned GPU process restarts from the same base, so an ID from a dead GPU process can name an unrelated frame in the new one.
Now WebContent allocates the reference itself for frames it requests, passing it as a new argument on RemoteGraphicsContextGL::SurfaceBufferToVideoFrame, RemoteAudioVideoRendererProxyManager::CurrentVideoFrame and RemoteMediaPlayerProxy::VideoFrameForCurrentTimeIfChanged. The GPU process stores the frame with the new add(reference, frame) and builds the reply with RemoteVideoFrameProxy::properties(). Frames the GPU process produces on its own (metadata, WebRTC decoder output, capture) still get a GPU-allocated reference, now sent as a separate argument on PushVideoFrameMetadata, CompletedDecoding and VideoFrameAvailable. RemoteVideoFrameProxy::newReadReference() and SharedVideoFrameWriter::write() now take the IPC connection and fail for frames bound to a different GPU process connection.
Before: After:
WebContent GPUProcess WebContent GPUProcess
│ Request ───────► │ │ reserve ref (WCP domain)
│ ├ heap.add(frame)→ref │ Request(ref) ───────► │
│ ◄── Properties(ref) ┤ │ ├ props = properties(frame)
│ (blocks for ID) │ ◄── Properties ───────┤ heap.add(ref, frame)
│ newReadReference(conn) -> fails if frame bound
│ to a different GPUP connection
Significance
Reserving references in WebContent lets fast paths create video frame references asynchronously, which is groundwork for faster frame transfer. The GPU process now inserts frames under IDs chosen by the less-trusted WebContent process, across WebGL, media player and audio/video renderer entry points. The top-bit domain split keeps the two processes' IDs from colliding, and the connection binding keeps stale IDs from a previous GPU process out.
Audit directions
The trust shift is that IDs now come from the renderer, so the questions are about what the GPU process does with an ID it did not mint:
RemoteVideoFrameObjectHeap::add(reference, frame)does no domain validation and onlyASSERTs that insertion succeeded;isInGPUProcessObjectIdentifierDomainis consulted only inget(). Check what a compromised WebContent gains by supplying a duplicate reference, one already in use, or one in the GPU-process domain, and whether release builds silently drop or alias the frame.get()now waits up to 10s for references outside the GPU domain. A reference that is never populated can stall the consumer's work queue for up to 10s per request; check which queue runsget()(for example WebGLcopyTextureFromVideoFrameon its own stream) and whether that becomes a practical DoS or a race window with the producing request.- Stale-ID protection lives on the WebContent side, in
newReadReference(connection)andSharedVideoFrameWriter::write(). Every call site (WebGL, 2D canvasdrawVideoFrame, WebGPU device/queue, encoder, display layer) must pass the connection its stream was created on; a missed site, or a connection that changes after a GPU process restart, reintroduces aliasing. - When the GPU process returns
nulloptafter WebContent reserved a reference, nothing should point at a heap entry that never existed; also review the removedreleaseUnused(). - At about 45 files, a mismatched message signature or one missed caller is plausible.