[webkit-changes] [WebKit/WebKit] 01bfc8: [iOS] Crashes when WebValidationBubbleViewControll...

Ali Juma noreply at github.com
Thu Feb 9 14:28:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 01bfc814e82974f331eaf1523356e79211574e2f
      https://github.com/WebKit/WebKit/commit/01bfc814e82974f331eaf1523356e79211574e2f
  Author: Ali Juma <ajuma at chromium.org>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M Source/WebCore/platform/ValidationBubble.h
    M Source/WebCore/platform/ios/ValidationBubbleIOS.mm

  Log Message:
  -----------
  [iOS] Crashes when WebValidationBubbleViewController is presented twice
https://bugs.webkit.org/show_bug.cgi?id=251548

Reviewed by Wenson Hsieh.

The logic in ValidationBubble::show to guard against presenting the view
controller when it is already presented has a race condition. After starting
to present the view controller, this view controller doesn't immediately have
a parent view controller or presenting view controller, and yet these are
the conditions used to guard against presenting it twice. This means there is
a short window where a second call to ValidationBubble::show will not
early-out, but will instead try to present the view controller again,
leading to an exception in UIKit.

Fix this issue by adding a bool that tracks when the view controller is in
the process of being presented.

No tests since the conditions that trigger this bug require precise timing of
web content triggering a validation bubble along with scrolling/zooming in
the UIProcess starting and ending exactly during the time that the view
controller is in the process of being presented.

* Source/WebCore/platform/ValidationBubble.h:
* Source/WebCore/platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show):

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




More information about the webkit-changes mailing list