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

NoQ via All-commits all-commits at lists.llvm.org
Mon Jan 11 06:45:00 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c163aae45ef6b7f3bd99601195d3ce4aad5850c6
      https://github.com/llvm/llvm-project/commit/c163aae45ef6b7f3bd99601195d3ce4aad5850c6
  Author: Artem Dergachev <artem.dergachev at gmail.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
    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.

Differential Revision: https://reviews.llvm.org/D91898




More information about the All-commits mailing list