diff options
author | Vlad Tsyrklevich <vtsyrklevich@chromium.org> | 2018-01-04 16:39:45 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-08 15:06:51 +0000 |
commit | dc36f99188feec82454f62d5f489f358dc5fd9c1 (patch) | |
tree | 9a505d3183a445435a84f7a367c34fdfaa9cc26f | |
parent | ec24b2e338de2a6211723f19f54386c950ac5010 (diff) | |
download | pdfium-dc36f99188feec82454f62d5f489f358dc5fd9c1.tar.xz |
Reland "[CFI] Enable type generalization for LCMS"
This relands commit 7829b7048d5cf13a4f1a806fed57f2440d1b5dec.
This uses a new version of clang with a fix for the LSan issue that
caused the previous revert.
Original change's description:
> [CFI] Enable type generalization for LCMS
>
> Control Flow Integrity [1] indirect call checking verifies that function
> pointers only call valid functions with a matching type signature. This
> condition can be too strict, a common form of 'abstraction' relies on
> function pointers being cast to generalize argument pointer types to
> void*.
>
> In LCMS these failures occur because of casts of function pointers called
> as both _cmsInterpFn16 (cmsInterpFunction.Lerp16) and _cmsOPTeval16Fn (as
> an argument to _cmsPipelineSetOptimizationParameters) types making it
> difficult to refactor out easily. Instead, enabling the type
> generalization build config weakens the type checking performed for
> CFI-icall to accomodate this common type of casts.
>
> [1] https://www.chromium.org/developers/testing/control-flow-integrity
>
> Bug: 785442
> Change-Id: Ib42fb1b4e152d5042b170698c2707ebb9e0cc1ee
> Reviewed-on: https://pdfium-review.googlesource.com/19250
> Commit-Queue: dsinclair <dsinclair@chromium.org>
> Reviewed-by: dsinclair <dsinclair@chromium.org>
Bug: 785442
Change-Id: Ice696e4f496fa380f8af053577bde7e46c049590
Reviewed-on: https://pdfium-review.googlesource.com/22265
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | third_party/BUILD.gn | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -18,7 +18,7 @@ vars = { 'build_revision': '097c79babc9b2ce40b61c3e33da1c6681acf837c', 'buildtools_revision': 'b36c7b60ed73919b157c7d23ec5fce2aa69ab05e', 'catapult_revision': 'd624b3ced2c81d4fb4ea98a8dbb4532272cc1e0a', - 'clang_revision': '8427dae2b5a769314af722e09000563b5184ba06', + 'clang_revision': 'ac1e5f78c39dc2a262af149404dd36c140eecdc1', 'cygwin_revision': 'c89e446b273697fadf3a10ff1007a97c0b7de6df', 'depot_tools_revision': '2e8d8348b8574f06c26dbf3ef959b5df11ba5148', 'freetype_revision': '2c048a8a622e9f44f255aa3316026f124ac9ecbc', diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index e0874ea570..d9f7670bb5 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -249,6 +249,7 @@ static_library("fx_lcms2") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code", + "//build/config/sanitizers:cfi_icall_generalize_pointers", ":pdfium_third_party_config", # Must be after no_chromium_code for warning flags to be ordered correctly. |