[cfi-icall] Store GTK function in ProtectedMemory

Control Flow Integrity [1] indirect call (cfi-icall) checking can not
verify that dynamically resolved function pointers call their intended
function. Instead we place the pointer for gdk_set_allowed_backends in
ProtectedMemory, a wrapper for keeping variables in read-only memory
except for when they are initialized.  After setting the pointer in
protected memory we can use the UnsanitizedCfiCall wrapper to disable
cfi-icall checking when calling it since we know it can not be tampered
with.

[1] https://www.chromium.org/developers/testing/control-flow-integrity

Bug: 771365
Change-Id: I5c359697c466921084aea17cda655231fdc33a92
Reviewed-on: https://chromium-review.googlesource.com/775617
Reviewed-by: Elliot Glaysher <erg@chromium.org>
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520657}
GitOrigin-RevId: e683c7e9e0616d33876022da8ebd0a82f341e0b3
1 file changed
tree: 2477ac16ff7bdca3534ed58f5f8130179e4f627b
  1. blacklist.txt
  2. blacklist_android.txt
  3. OWNERS