summaryrefslogtreecommitdiff
path: root/third_party/BUILD.gn
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vtsyrklevich@chromium.org>2017-11-29 14:32:19 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-29 14:32:19 +0000
commit7829b7048d5cf13a4f1a806fed57f2440d1b5dec (patch)
treeeab782e5653e5513eb554d5f4910fcf52dab39df /third_party/BUILD.gn
parent1ff9b7ffa653de1d25c5e013d731054815b13e86 (diff)
downloadpdfium-7829b7048d5cf13a4f1a806fed57f2440d1b5dec.tar.xz
[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>
Diffstat (limited to 'third_party/BUILD.gn')
-rw-r--r--third_party/BUILD.gn1
1 files changed, 1 insertions, 0 deletions
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index a188f56194..863ab9e48b 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -248,6 +248,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.