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

Issue 1359693002: CFI: avoid a bad cast in InsertBeforeAndInvalidateAllPointers. (Closed)

Created:
5 years, 3 months ago by krasin
Modified:
5 years, 3 months ago
Reviewers:
weiliangc, ccameron
CC:
cc-bugs_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CFI: avoid a bad cast in InsertBeforeMany. Instead of dereferencing an iterator pointing to non-initialized memory (which requires a cast to the element type pointer), pass a char* memory pointer to new(). BUG=chromium:531664, chromium:457523 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/93f671bcf253ae4df5e054b542bd31a4eb17023b Cr-Commit-Position: refs/heads/master@{#350035}

Patch Set 1 : simplify #

Total comments: 4

Patch Set 2 : fixed another instance #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M cc/base/list_container.h View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
krasin
5 years, 3 months ago (2015-09-21 18:45:44 UTC) #3
ccameron
Thanks! lgtm (with the suggestion). https://codereview.chromium.org/1359693002/diff/20001/cc/base/list_container.h File cc/base/list_container.h (right): https://codereview.chromium.org/1359693002/diff/20001/cc/base/list_container.h#newcode127 cc/base/list_container.h:127: return new (*at) DerivedElementType(); ...
5 years, 3 months ago (2015-09-21 19:01:39 UTC) #4
weiliangc
Thanks for catching this! The problem happens when we dereference an Iterator on uninitialized memory. ...
5 years, 3 months ago (2015-09-21 19:04:18 UTC) #6
krasin
https://codereview.chromium.org/1359693002/diff/20001/cc/base/list_container.h File cc/base/list_container.h (right): https://codereview.chromium.org/1359693002/diff/20001/cc/base/list_container.h#newcode127 cc/base/list_container.h:127: return new (*at) DerivedElementType(); On 2015/09/21 19:04:18, weiliangc wrote: ...
5 years, 3 months ago (2015-09-21 20:43:35 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1359693002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1359693002/40001
5 years, 3 months ago (2015-09-21 20:44:28 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:40001)
5 years, 3 months ago (2015-09-21 21:52:04 UTC) #11
commit-bot: I haz the power
5 years, 3 months ago (2015-09-21 21:53:06 UTC) #12
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/93f671bcf253ae4df5e054b542bd31a4eb17023b
Cr-Commit-Position: refs/heads/master@{#350035}

Powered by Google App Engine
This is Rietveld 408576698