Tor should wipe key material before common crash conditions, to avoid key material leak in the case where relay operators have otherwise taken steps to keep key material off of disk.
There are two vectors towards obtaining key material after crash: core files, and large mmap attempts by other users' processes.
It turns out many OS kernels do not provide ways to defend against the latter case. Therefore, tor should attempt to wipe sensitive key material on atexit, SIGSEGV, SIGBUS, tor_assert() and other common exit conditions.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Clarification: This ticket is for wiping key material from memory, not disk. The presumption is that the keys have already been removed from disk (and possibly stored offsite) manually by the relay admin.
Not storing keys on disk in the first place and other forms of relay key agility should be considered in separate tickets, as they are more involved than this specific issue.
Trac: Summary: Wipe relay keys on common crash conditions to Wipe relay key material from memory on common crash conditions
I've heard worse ideas. I'd want the code here to be absolutely bulletproof, and to get invoked as part of our regular shutdown logic (so that it would see some testing).
This "common crash conditions" idea is one where I'd like to see what you have in mind enumerated.
We might need to ignore Libevent's regular signal logic, since it isn't meant for signals that have put an unknown portion of the process into a non-runnable state.
How much sensitive material is there? Just a shot in the dark, but perhaps the material could be encrypted in order to keep the amount of time it's decrypted very short, so all it takes is wiping the master key from memory to make the rest of the encrypted sensitive material in memory unreadable. When the process is in an undefined state (according to POSIX, SIGSEGV not induced by raise(3) or kill(2) puts a process in such a state), it would be much easier for it to wipe a single page than it would be to find and wipe a time-varying amount of memory in multiple locations.
What key material is being considered as sensitive here? Is it only private keys, or does it also include ephemeral session keys and related information? It's important to determine what's in scope.
Also, coredumps do not have to be an issue if Tor sets prctl(PR_SET_DUMPABLE, 0).