-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to reboot pivot binary and completely wipe its memory #124
Comments
To clarify: With regards to the memory clean up: it is likely not sufficient to check which memory the pivot binary currently holds and overwrite that the pivot binary it plausibly allocated, used and de-allocated other memory regions before (that are no longer referenced at the moment of wiping). Hence we may have to wipe all free memory after killing the process to be sure no data remains in memory. |
@cr-tky Just a restart of the process we spawned to execute the pivot binary. So QOS would keep running and not be restarted, but it would halt the pivot binary process, wipe its memory, and then restart. My thinking is that it would be too much strain on the system to constantly re-attest to a QOS Node, but re-spawning the Pivot Binary seems more reasonable since its a self contained process and the Enclave Apps we have thus far are generally designed to not need any persistent data in memory.
What do you mean by "free memory" here? Does this mean all memory or just the memory that is marked as not in use? |
Understood. In that case, I think we have to be very deliberate around the wording of any "restart" or "reboot" so that it is always clear to readers which steps are and aren't performed automatically or with certainty. I previously talked with @lrvick about various schemes of small- or large-scale restarts, and as you say they all bring their own trade-offs in terms of performance, complexity, risk and so on. Especially if we want to clean states often, for example after important operations, we need solutions that don't bring a huge overhead.
In my mind, some small part of the QOS running as pid0/pid1 hold a small amount of memory (a few megabytes !?) of the enclave VM memory as it continues running "across" the pivot binary kill and re-initialization. Therefore, not all memory in the enclave can be wiped, only the "free" memory that's not allocated to any running process (-> marked as not in use) at the point of the memory scrubbing. I can think of a potential edge case that could be relevant to this scheme in terms of security.
I think it would be interesting to discuss how we can prevent or mitigate this situation. For example, if the QOS process never allocates new heap memory after it has started the Pivot Binary, I think this situation is avoided. Similarly, if there is a special mechanism to divide and tag memory into separate pools (pool 1: QOS system, pool 2: Pivot Binary) so that they can't share discarded memory, that would also be interesting. My intuition is that normally Linux doesn't need or provide such a functionality (which is more VM-hypervisor-like) and only offers limitations in terms of numerical resource limits, but maybe there's a way to enforce this with special cgroups settings or other native but less-known mechanisms. |
Add QOS functionality to regularly reboot and wipe the memory of an Enclave Application.
A predecessor to this would be some utility that can take an arbitrary binary, spawn it, and then kill it, making sure its memory is wiped when the process gets killed.
ref: #122
The text was updated successfully, but these errors were encountered: