Changeset 242917 in webkit
- Timestamp:
- Mar 13, 2019, 4:18:26 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/remove-associated-element-after-gc-expected.txt (added)
-
LayoutTests/fast/forms/remove-associated-element-after-gc.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLFormControlElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLFormElement.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242914 r242917 1 2019-03-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element 4 https://bugs.webkit.org/show_bug.cgi?id=195663 5 <rdar://problem/48576391> 6 7 Reviewed by Ryosuke Niwa. 8 9 Add a layout test to exercise the scenario described in the WebCore ChangeLog. 10 11 * fast/forms/remove-associated-element-after-gc-expected.txt: Added. 12 * fast/forms/remove-associated-element-after-gc.html: Added. 13 1 14 2019-03-13 Nikita Vasilyev <nvasilyev@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r242915 r242917 1 2019-03-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element 4 https://bugs.webkit.org/show_bug.cgi?id=195663 5 <rdar://problem/48576391> 6 7 Reviewed by Ryosuke Niwa. 8 9 Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form 10 control element is ref'd while carrying out its destructor's logic. This may happen in two places in 11 HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a 12 protected reference to the form control element since they should never result in any script execution. 13 14 To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that 15 we don't change these codepaths in the future, such that they trigger arbitrary script execution. 16 17 Test: fast/forms/remove-associated-element-after-gc.html 18 19 * html/HTMLFormControlElement.cpp: 20 (WebCore::HTMLFormControlElement::didChangeForm): 21 * html/HTMLFormElement.cpp: 22 (WebCore::HTMLFormElement::resetDefaultButton): 23 1 24 2019-03-13 Daniel Bates <dabates@apple.com> 2 25 -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r242792 r242917 42 42 #include "RenderBox.h" 43 43 #include "RenderTheme.h" 44 #include "ScriptDisallowedScope.h" 44 45 #include "Settings.h" 45 46 #include "StyleTreeResolver.h" … … 558 559 void HTMLFormControlElement::didChangeForm() 559 560 { 561 ScriptDisallowedScope::InMainThread scriptDisallowedScope; 562 560 563 FormAssociatedElement::didChangeForm(); 561 if ( RefPtr<HTMLFormElement>form = this->form()) {564 if (auto* form = this->form()) { 562 565 if (m_willValidateInitialized && m_willValidate && !isValidFormControlElement()) 563 566 form->registerInvalidAssociatedFormControl(*this); -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r241932 r242917 705 705 } 706 706 707 RefPtr<HTMLFormControlElement> oldDefault = m_defaultButton; 707 ScriptDisallowedScope::InMainThread scriptDisallowedScope; 708 709 auto* oldDefault = m_defaultButton; 708 710 m_defaultButton = nullptr; 709 711 defaultButton();
Note:
See TracChangeset
for help on using the changeset viewer.