microsoft / MSRSec

Security and Privacy Research at Microsoft
MIT License
37 stars 28 forks source link

Track NV data use #8

Closed dmcilvaney closed 5 years ago

dmcilvaney commented 5 years ago

Track the current utilization of NV memory (same mechanism as volatile memory). The TA was allowing enough variables to be created that OP-TEE was running out of internal heap space.

MAX_NV_STORAGE is set to 64K (Windows recommended miniumum), as is MAX_VOLATILE_STROAGE.

dmcilvaney commented 5 years ago

Nothing scientific, I'll try turning it back down (256 at 2*worst seems like it would be reasonable) but I was running out of memory so I just doubled it until it stopped complaining. That change was done quite a while ago, we can probably back that off again.

dmcilvaney commented 5 years ago

During testing I noticed that leaving the handles open causes the OP-TEE kernel to run out of heap quite quickly. Opening/closing a handle is a very fast operation.