Changeset 242861 in webkit
- Timestamp:
- Mar 13, 2019, 1:24:54 AM (7 years ago)
- Location:
- branches/safari-607-branch
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/events/contextmenu-reentrancy-crash-expected.txt (added)
-
LayoutTests/fast/events/contextmenu-reentrancy-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/ContextMenuController.cpp (modified) (2 diffs)
-
Source/WebCore/page/ContextMenuController.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-607-branch/LayoutTests/ChangeLog
r242858 r242861 1 2019-03-13 Babak Shafiei <bshafiei@apple.com> 2 3 Cherry-pick r242749. rdar://problem/48839358 4 5 [macOS] Dispatching reentrant "contextmenu" events may cause crashes 6 https://bugs.webkit.org/show_bug.cgi?id=195571 7 <rdar://problem/48086046> 8 9 Reviewed by Andy Estes. 10 11 Source/WebCore: 12 13 Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag. 14 As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a 15 synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as 16 a result of handling a context menu event. 17 18 Test: fast/events/contextmenu-reentrancy-crash.html 19 20 * page/ContextMenuController.cpp: 21 (WebCore::ContextMenuController::handleContextMenuEvent): 22 * page/ContextMenuController.h: 23 24 LayoutTests: 25 26 Add a test to verify that triggering reentrant "contextmenu" events from script does not cause a crash. 27 28 * fast/events/contextmenu-reentrancy-crash-expected.txt: Added. 29 * fast/events/contextmenu-reentrancy-crash.html: Added. 30 31 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242749 268f45cc-cd09-0410-ab3c-d52691b4dbfc 32 33 2019-03-11 Wenson Hsieh <wenson_hsieh@apple.com> 34 35 [macOS] Dispatching reentrant "contextmenu" events may cause crashes 36 https://bugs.webkit.org/show_bug.cgi?id=195571 37 <rdar://problem/48086046> 38 39 Reviewed by Andy Estes. 40 41 Add a test to verify that triggering reentrant "contextmenu" events from script does not cause a crash. 42 43 * fast/events/contextmenu-reentrancy-crash-expected.txt: Added. 44 * fast/events/contextmenu-reentrancy-crash.html: Added. 45 1 46 2019-03-13 Babak Shafiei <bshafiei@apple.com> 2 47 -
branches/safari-607-branch/Source/WebCore/ChangeLog
r242858 r242861 1 2019-03-13 Babak Shafiei <bshafiei@apple.com> 2 3 Cherry-pick r242749. rdar://problem/48839358 4 5 [macOS] Dispatching reentrant "contextmenu" events may cause crashes 6 https://bugs.webkit.org/show_bug.cgi?id=195571 7 <rdar://problem/48086046> 8 9 Reviewed by Andy Estes. 10 11 Source/WebCore: 12 13 Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag. 14 As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a 15 synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as 16 a result of handling a context menu event. 17 18 Test: fast/events/contextmenu-reentrancy-crash.html 19 20 * page/ContextMenuController.cpp: 21 (WebCore::ContextMenuController::handleContextMenuEvent): 22 * page/ContextMenuController.h: 23 24 LayoutTests: 25 26 Add a test to verify that triggering reentrant "contextmenu" events from script does not cause a crash. 27 28 * fast/events/contextmenu-reentrancy-crash-expected.txt: Added. 29 * fast/events/contextmenu-reentrancy-crash.html: Added. 30 31 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242749 268f45cc-cd09-0410-ab3c-d52691b4dbfc 32 33 2019-03-11 Wenson Hsieh <wenson_hsieh@apple.com> 34 35 [macOS] Dispatching reentrant "contextmenu" events may cause crashes 36 https://bugs.webkit.org/show_bug.cgi?id=195571 37 <rdar://problem/48086046> 38 39 Reviewed by Andy Estes. 40 41 Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag. 42 As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a 43 synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as 44 a result of handling a context menu event. 45 46 Test: fast/events/contextmenu-reentrancy-crash.html 47 48 * page/ContextMenuController.cpp: 49 (WebCore::ContextMenuController::handleContextMenuEvent): 50 * page/ContextMenuController.h: 51 1 52 2019-03-13 Babak Shafiei <bshafiei@apple.com> 2 53 -
branches/safari-607-branch/Source/WebCore/page/ContextMenuController.cpp
r238894 r242861 69 69 #include "WindowFeatures.h" 70 70 #include "markup.h" 71 #include <wtf/SetForScope.h> 71 72 #include <wtf/WallTime.h> 72 73 #include <wtf/unicode/CharacterNames.h> … … 98 99 void ContextMenuController::handleContextMenuEvent(Event& event) 99 100 { 101 if (m_isHandlingContextMenuEvent) 102 return; 103 104 SetForScope<bool> isHandlingContextMenuEventForScope(m_isHandlingContextMenuEvent, true); 105 100 106 m_contextMenu = maybeCreateContextMenu(event); 101 107 if (!m_contextMenu) -
branches/safari-607-branch/Source/WebCore/page/ContextMenuController.h
r211033 r242861 94 94 RefPtr<ContextMenuProvider> m_menuProvider; 95 95 ContextMenuContext m_context; 96 bool m_isHandlingContextMenuEvent { false }; 96 97 }; 97 98
Note:
See TracChangeset
for help on using the changeset viewer.