[attributes] Add a facility for enforcing a Trusted Computing Base.
Introduce a function attribute 'enforce_tcb' that prevents the function from calling other functions without the same attribute. This allows isolating code that's considered to be somehow privileged so that it could not use its privileges to exhibit arbitrary behavior. Introduce an on-by-default warning '-Wtcb-enforcement' that warns about violations of the above rule. Introduce a function attribute 'enforce_tcb_leaf' that suppresses the new warning within the function it is attached to. Such leaf functions may implement common functionality between the trusted and the untrusted code but they require extra careful audit with respect to their capabilities. Fixes after a revert in 419ef38a: Fix a test. Add workaround for GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274). Attribute the patch appropriately! Differential Revision: https://reviews.llvm.org/D91898
Loading
Please sign in to comment