Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Issue 1315983004: Fix use-after-free bug in long press selection (Closed)

Created:
5 years, 3 months ago by majidvp
Modified:
5 years, 3 months ago
Reviewers:
yosin_UTC9, Rick Byers
CC:
blink-reviews, yosin_UTC9
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix use-after-free bug in long press text selection The crash occurs because longpress may cause script to run (blur, focus event handles) which may detach the frame. To prevent crashing we protect FrameView while handling the longpress event and also guard against |frame->settings()| being NULL which happens when frame detaches. BUG=519905 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201568

Patch Set 1 #

Patch Set 2 : add expectation #

Patch Set 3 : Add fix #

Patch Set 4 : fix minor issue #

Total comments: 15

Patch Set 5 : Address review feedback #

Total comments: 6

Patch Set 6 : address feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -2 lines) Patch
A LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash.html View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M Source/core/input/EventHandler.cpp View 1 2 3 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
majidvp
5 years, 3 months ago (2015-08-28 21:06:13 UTC) #2
majidvp
On 2015/08/28 21:06:13, majidvp wrote: FYI, I ensured that the test reproduces the crash before ...
5 years, 3 months ago (2015-08-28 21:09:12 UTC) #3
Rick Byers
LGTM
5 years, 3 months ago (2015-08-29 20:54:00 UTC) #4
yosin_UTC9
https://codereview.chromium.org/1315983004/diff/60001/LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt File LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt (right): https://codereview.chromium.org/1315983004/diff/60001/LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt#newcode1 LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt:1: Test passes if it does not crash. nit: Can ...
5 years, 3 months ago (2015-08-31 02:11:13 UTC) #6
majidvp
yosin@: PTAL. I updated the test to use testharness.js. https://codereview.chromium.org/1315983004/diff/60001/LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt File LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt (right): https://codereview.chromium.org/1315983004/diff/60001/LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt#newcode1 LayoutTests/editing/selection/longpress-selection-in-iframe-removed-crash-expected.txt:1: ...
5 years, 3 months ago (2015-08-31 18:06:25 UTC) #7
yosin_UTC9
lgtm w/ nits https://codereview.chromium.org/1315983004/diff/60001/Source/core/input/EventHandler.cpp File Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/1315983004/diff/60001/Source/core/input/EventHandler.cpp#newcode2789 Source/core/input/EventHandler.cpp:2789: if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) On 2015/08/31 ...
5 years, 3 months ago (2015-09-01 01:33:29 UTC) #8
majidvp
https://codereview.chromium.org/1315983004/diff/60001/Source/core/input/EventHandler.cpp File Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/1315983004/diff/60001/Source/core/input/EventHandler.cpp#newcode2789 Source/core/input/EventHandler.cpp:2789: if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) On 2015/09/01 01:33:28, Yosi_UTC9 wrote: ...
5 years, 3 months ago (2015-09-01 15:33:53 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1315983004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1315983004/100001
5 years, 3 months ago (2015-09-01 17:34:26 UTC) #12
commit-bot: I haz the power
5 years, 3 months ago (2015-09-01 18:42:09 UTC) #13
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=201568

Powered by Google App Engine
This is Rietveld 408576698