Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a97574d77c8f44a8ceca22d7a2647b1b0b99c5b
      
https://github.com/WebKit/WebKit/commit/6a97574d77c8f44a8ceca22d7a2647b1b0b99c5b
  Author: Zak Ridouh <[email protected]>
  Date:   2026-07-02 (Thu, 02 Jul 2026)

  Changed paths:
    A 
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-registry-update-crash-expected.txt
    A 
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-registry-update-crash.html
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h

  Log Message:
  -----------
  Fix Cross-thread use-after-free in 
RemoteScrollingTree::m_progressBasedTimelineRegistry
<https://bugs.webkit.org/show_bug.cgi?id=314585>
<rdar://176483524>

Reviewed by Antoine Quint.

m_progressBasedTimelineRegistry was freed on the main thread by
updateTimelinesRegistration() while the ScrollingThread read it via
serviceScrollAnimations -> updateProgressBasedTimelinesForNode,
producing an ASan heap-use-after-free. The reader held m_treeLock; the
writer held only m_animationLock, so the two paths were not serialized.

Add a dedicated m_progressBasedTimelineRegistryLock that guards the
registry pointer and is acquired by every reader and writer. A separate
lock avoids self-deadlock when scrollingTreeNodeDidScroll() reaches
updateProgressBasedTimelinesForNode from the commit path with
m_treeLock already held.

Test: 
webanimations/threaded-animations/scroll-driven-animation-registry-update-crash.html

* 
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-registry-update-crash-expected.txt:
 Added.
* 
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-registry-update-crash.html:
 Added.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::updateTimelinesRegistration):
(WebKit::RemoteScrollingTree::timeline const):
(WebKit::RemoteScrollingTree::updateProgressBasedTimelinesForNode):
(WebKit::RemoteScrollingTree::timelinesForScrollingNodeIDForTesting const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h:

Originally-landed-as: 305413.960@safari-7624-branch (3bff1cc45724). 
rdar://180438667
Canonical link: https://commits.webkit.org/316438@main



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

Reply via email to