|
|
DescriptionFix AlignedMemory initialization in base/optional.h
AlignedMemory::data_as<T>() casts a void pointer to AlignedMemory::data_ to a T
pointer. Before initializing an AlignedMemory instance, AlignedMemory::data_
contains garbage so trying to cast a void pointer to it to a T pointer results in
a CFI violation.
BUG=619351
Committed: https://crrev.com/3fd03b556675834c683e1453a168a874269b83fc
Cr-Commit-Position: refs/heads/master@{#399956}
Patch Set 1 #Patch Set 2 : Fix windows #
Total comments: 2
Messages
Total messages: 19 (9 generated)
The CQ bit was checked by ortuno@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066053002/1
The CQ bit was checked by ortuno@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066053002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
krasin@google.com changed reviewers: + krasin@google.com
lgtm https://codereview.chromium.org/2066053002/diff/20001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/2066053002/diff/20001/base/optional.h#newcode243 base/optional.h:243: new (storage_.buffer_.void_data()) T(value); Right. Before new is called, storage_buffer contains garbage and can't be cast to T. That's why CFI check fails. Thank you for spotting this!
Description was changed from ========== Change AlignedMemory usage to match documentation This was generating a bad cast and making the CFI bot fail. See bug for more details. BUG=619351 ========== to ========== Fix AlignedMemory initialization in base/optional.h AlignedMemory::data_as<T>() casts a void pointer to AlignedMemory::data_ to a T pointer. Before initializing AlignedMemory::data_ contains garbage so trying to cast a void pointer to it to a T pointer results in a CFI violation. BUG=619351 ==========
https://codereview.chromium.org/2066053002/diff/20001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/2066053002/diff/20001/base/optional.h#newcode243 base/optional.h:243: new (storage_.buffer_.void_data()) T(value); On 2016/06/15 at 06:24:13, krasin wrote: > Right. Before new is called, storage_buffer contains garbage and can't be cast to T. That's why CFI check fails. > > Thank you for spotting this! Thanks for the explanation!
Description was changed from ========== Fix AlignedMemory initialization in base/optional.h AlignedMemory::data_as<T>() casts a void pointer to AlignedMemory::data_ to a T pointer. Before initializing AlignedMemory::data_ contains garbage so trying to cast a void pointer to it to a T pointer results in a CFI violation. BUG=619351 ========== to ========== Fix AlignedMemory initialization in base/optional.h AlignedMemory::data_as<T>() casts a void pointer to AlignedMemory::data_ to a T pointer. Before initializing an AlignedMemory instance, AlignedMemory::data_ contains garbage so trying to cast a void pointer to it to a T pointer results in a CFI violation. BUG=619351 ==========
ortuno@chromium.org changed reviewers: + danakj@chromium.org
danakj: PTAL at this fix.
LGTM
The CQ bit was checked by ortuno@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066053002/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Fix AlignedMemory initialization in base/optional.h AlignedMemory::data_as<T>() casts a void pointer to AlignedMemory::data_ to a T pointer. Before initializing an AlignedMemory instance, AlignedMemory::data_ contains garbage so trying to cast a void pointer to it to a T pointer results in a CFI violation. BUG=619351 ========== to ========== Fix AlignedMemory initialization in base/optional.h AlignedMemory::data_as<T>() casts a void pointer to AlignedMemory::data_ to a T pointer. Before initializing an AlignedMemory instance, AlignedMemory::data_ contains garbage so trying to cast a void pointer to it to a T pointer results in a CFI violation. BUG=619351 Committed: https://crrev.com/3fd03b556675834c683e1453a168a874269b83fc Cr-Commit-Position: refs/heads/master@{#399956} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/3fd03b556675834c683e1453a168a874269b83fc Cr-Commit-Position: refs/heads/master@{#399956} |