build: Add a new build flag, use_cfi_icall.

This flag enables CFI for indirect calls via a function pointer.

BUG=701919
R=thakis@chromium.org

Review-Url: https://codereview.chromium.org/2749393002
Cr-Original-Commit-Position: refs/heads/master@{#457229}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a7bb0b59a2a4c5918ddfa951f91591ddee7d468e
This commit is contained in:
pcc 2017-03-15 15:12:02 -07:00 коммит произвёл Commit bot
Родитель 15d5fcab1c
Коммит 37349a7461
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -385,6 +385,10 @@ config("cfi_flags") {
]
}
if (use_cfi_icall) {
cflags += [ "-fsanitize=cfi-icall" ]
}
if (use_cfi_diag) {
cflags += [
"-fno-sanitize-trap=cfi",

Просмотреть файл

@ -62,6 +62,11 @@ declare_args() {
# https://crbug.com/626794
use_cfi_cast = false
# Enable checks for indirect function calls via a function pointer.
# TODO(pcc): remove this when we're ready to add these checks by default.
# https://crbug.com/701919
use_cfi_icall = false
# By default, Control Flow Integrity will crash the program if it detects a
# violation. Set this to true to print detailed diagnostics instead.
use_cfi_diag = false