[all-commits] [llvm/llvm-project] 35c9ba: [attributes] Add a facility for enforcing a Trust...

llvmbot via All-commits all-commits at lists.llvm.org
Mon Jan 11 10:25:59 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 35c9baa11e4be6ae570674eec2de8bd928639b18
      https://github.com/llvm/llvm-project/commit/35c9baa11e4be6ae570674eec2de8bd928639b18
  Author: Sean Dooher <sdooher at apple.com>
  Date:   2021-01-11 (Mon, 11 Jan 2021)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test
    A clang/test/Sema/attr-enforce-tcb-errors.cpp
    A clang/test/Sema/attr-enforce-tcb.c
    A clang/test/Sema/attr-enforce-tcb.cpp

  Log Message:
  -----------
  [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 419ef38a50293c58078f830517f5e305068dbee6:
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




More information about the All-commits mailing list