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

Intercept LLVM standard C library intrinsics #11

Open jovanbulck opened 7 years ago

jovanbulck commented 7 years ago

Problem. When working for instance with strings or structs, the compiler might insert i.a., hidden memcpy operations. These function calls are currently not picked up by the Sancus LLVM pass, as they are represented as intrinsics at the IR level.

Proposed solution. Sancus LLVM pass should recognize these special intrinsics, and replace them with a call into an intra-SM C library function stub (e.g. __sm#name#_memcpy).