[CFI] Enable cfi-icall type generalization

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*. For example, qsort() accepts two const void*s but the
implementations are likely to implement the comparison function using
pointers to the specific type being sorted.

This function relaxes cfi-icall type checking for code that uses this
pattern by using the new -fsanitize-cfi-icall-generalize-pointers
argument. It considers all pointer types equal as long as their
qualifiers match.

TBR=drott@chromium.org,rsleevi@chromium.org,piman@chromium.org

Bug: 785442
Change-Id: Ic9487908b6372898f031502c84284d008a3fdec1
Reviewed-on: https://chromium-review.googlesource.com/777555
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Johann Koenig <johannkoenig@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518446}
GitOrigin-RevId: 521fd17a903cdae78c797770348320d99064b0cc
1 file changed
tree: 041304f0c38303b0b7486ae5fa1b979b51418d6d
  1. blacklist.txt
  2. blacklist_android.txt
  3. OWNERS