sancus-tee / sancus-compiler

Secure compilation of annotated C code to Sancus enclaves
GNU General Public License v3.0
6 stars 7 forks source link

Secure SM_DATA initialization #4

Open jovanbulck opened 7 years ago

jovanbulck commented 7 years ago

We cannot rely upon the untrusted main init procedure to initialize module-private memory. Moreover, upon enabling a protected module, a Sancus-enabled processor zeroes out the entire private data section.

To avoid having to always write your own initialization procedure, the compiler should generate an sm_init procedure, included in the SM's text section and automatically called upon the first invocation after enabling SM protection.