Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70e39a01ecebf7473ac1a3f4670b47f1222c65ce
      
https://github.com/WebKit/WebKit/commit/70e39a01ecebf7473ac1a3f4670b47f1222c65ce
  Author: zbleyen <[email protected]>
  Date:   2026-02-09 (Mon, 09 Feb 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/WKScreenTimeConfigurationObserver.mm

  Log Message:
  -----------
  Concurrent XPC configuration updates in WKScreenTimeConfigurationObserver can 
cause crash

https://bugs.webkit.org/show_bug.cgi?id=303024

Reviewed by Aditya Keerthi.

The bug occurred because the private method `[STScreenTimeConfigurationObserver 
setConfiguration:]` could be called
concurrently from multiple XPC connection callbacks. Even though the 
`configuration` property itself is atomic,
the Key-Value Observing (KVO) process for notifying observers is not 
thread-safe. Concurrent modifications from
multiple threads could cause internal inconsistency and crashes within the KVO 
machinery.

To fix this, we now create a dedicated static serial dispatch queue 
(`screenTimeUpdateQueueSingleton`) within
`WKScreenTimeConfigurationObserver`. All XPC communication and configuration 
updates are dispatched to this queue,
ensuring that the entire process of modifying the configuration and sending KVO 
notifications is serialized and
thread-safe. This matches the pattern used elsewhere in WebKit for serializing 
access to shared resources from
asynchronous callbacks.

* Source/WebKit/UIProcess/Cocoa/WKScreenTimeConfigurationObserver.mm:
(screenTimeUpdateQueueSingleton): Added.
(-[WKScreenTimeConfigurationObserver startObserving]): Use shared queue.

Canonical link: https://commits.webkit.org/307131@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to