Race condition - file system access in Tor (toctou bugs)
I have scanned tor-0.2.2.27-beta with Fortify, which picked up a few issues in the "Race Condition: File System Access" category. I believe we have discussed these types of issues before, but I couldn't find a bug where they were all listed.
config.c:4723 - regarding the window of time between the call to read_file_to_str() and rename().
config.c:5124 - regarding the window of time between the call to read_file_to_str() and or_state_save_broken().
config.c:5138 - regarding the window of time between the call to read_file_to_str() and or_state_save_broken().
routerlist.c:835 - regarding the window of time between the call to tor_mmap_file() and remove_file_if_very_old().
I don't think we need to worry too much about these issues, but maybe we should be sure to check the files before we read/write/execute/move?