Re: [PATCH 05/15] x86: Implement function_nocfi

From: Joao Moreira
Date: Mon Apr 19 2021 - 12:44:49 EST

Why not? In particular, I'd really like somebody to answer the question
"why not just store a cookie before each address-taken or
external-linkage function?".

FWIIW, this was done before (at least twice): First with grsecurity/PaX RAP ( then with kCFI (, - which is no longer maintained).

At the time I worked on kCFI someone raised a concern regarding this cookie-based design being mutually exclusive to execute-only memories (XOM), what, if XOM is really relevant to someone, should be a valid concern.

Since design is being questioned, an x86/CET-specific third design for CFI was recently discussed here: -- I assume that, arch-dependency considered, this should be easier to integrate when compared to clang-cfi. Also, given that it is based on CET, this also has the benefit of constraining mispeculations (which is a nice side-effect).

Tks, Joao