Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ea237a349ded2681fcb6ced807a8fc484f71a876
      
https://github.com/WebKit/WebKit/commit/ea237a349ded2681fcb6ced807a8fc484f71a876
  Author: Lauro Moura <[email protected]>
  Date:   2026-06-24 (Wed, 24 Jun 2026)

  Changed paths:
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/wpe/TestExpectations
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.h
    M Source/WebCore/platform/audio/glib/MediaSessionManagerGLib.h
    M Source/WebCore/testing/Internals.cpp

  Log Message:
  -----------
  [GLib][Site Isolation] Internals::resetToConsistentState corrupts memory with 
unchecked static_cast to MediaSessionManagerGLib in site-isolation tests
https://bugs.webkit.org/show_bug.cgi?id=316719

Reviewed by Nikolas Zimmermann.

Since 314640@main, WebPage installs a RemoteMediaSessionManager for
tests with SiteIsolationEnabled. As Internals::resetToConsistentState
unconditionally static_casts the manager to MediaSessionManagerGLib and
calls setters on it, it writes out of bounds on the actual underlying
object.

For example, this was leading to corruption of adjacent objects, like
the refcount of FontCascade-related classes or the vtable of objects
used by FrameLoader::stopAllLoaders.

This commit guards the MediaSessionManagerGLib with a dynamicDowncast,
so only objects of the proper type are written to, mirroring the pattern
already used in other classes in this file.

* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp:
(WebCore::MediaSessionManagerInterface::isMediaSessionManagerGLib const):
* Source/WebCore/platform/audio/MediaSessionManagerInterface.h:
* Source/WebCore/platform/audio/glib/MediaSessionManagerGLib.h:
(isType):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

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



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

Reply via email to