Commit 5139af43 authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[gRPC] Suppress CFI cast checks

ChromeOS builders build Chrome with CFI cast check enabled, so using
reinterpret_cast on invalid/uninitialized pointer will crash Chrome.
This is what happened in grpc_core::InlinedVector, which tries to use
reinterpret_cast before initializing the storage.

While the proper fix should be calling the placement-new operator
directly on the raw (void*) pointer, the easiest and safest fix for M76
is just to disable CFI cast checks when building the gRPC library.

I've verified that the crash was reproducible with
ftl_signaling_strategy if I add `is_cfi=true` (and other required
arguments) to GN args, and the crash goes away once I've added these
compiler flag.

Bug: 972108
Change-Id: Idf874a028af002fafe3a4905d70a3bca71777e42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660194
Commit-Queue: Joe Downing <joedow@chromium.org>
Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
Auto-Submit: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669203}
parent c5211647
......@@ -18,6 +18,7 @@ config("grpc_internal_config") {
cflags = [
"-Wno-implicit-fallthrough",
"-Wno-constant-conversion",
"-fno-sanitize=cfi-derived-cast,cfi-unrelated-cast",
]
defines = [ "GRPC_ARES=0" ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment