A less hackish, more portable approach would be to make a new thread to handle the sensitive data and map/unmap the memory for its stack yourself if supported.
-
-
Replying to @RichFelker @jhripley and
That would only get the stack, not the registers. The register save area for a pthread is not accessible to the application; the register save area for a swapcontext operation is accessible.
1 reply 0 retweets 0 likes -
When the thread terminates its register file is gone.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @jhripley and
The whole point of this exercise is that we don't trust the implementation to scrub things for us!
1 reply 0 retweets 0 likes -
For widely varying layers of "the implementation".
1 reply 0 retweets 0 likes -
Replying to @RichFelker @elwoz and
If you can't trust that user processes can't read physical memory they don't own, your OS is just crap. You can't mitigate this at user app level.
1 reply 0 retweets 0 likes
OTOH I'm showing a way you can mitigate inability to express in thd HLL (at least C) that certain data & everything derived from it is sensitive and must not be kept around.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.