An attacker can do evil things by rewinding a user's clock, without having to own their machine (e.g., NTP attacks).
Tor maintains a monotonic clock to prevent rewinding attacks while Tor is running. Tor also keeps some persistent information about the user's time in the state file, in the LastWritten field.
On launch, if Tor sees that the system time has been rewound to before the LastWritten time, it should warn the user that something strange is happening. However, Tor should not update the monotonic clock or fail to launch, since the user may have changed the time deliberately.
Trac: Username: hdevalence
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.
I'm happy to change the warning message, but it's quite long already, do you have a suggestion for the text we should use?
The current text is:
log_warn(LD_GENERAL, "Your system clock has been set back in time. " "Tor needs an accurate clock to know when the consensus " "expires. Clock time is %s, state file time is %s.", now_str, last_written_str);
i couldnt think of anything to leave out without reducing information.
Your clock goes wrong. Tor needs an accurate clock. Clock time is %s, state file time is %s. is shorter but much less precise. i'd prefer the original one.
this is the text i would add if it doesnt get too long: reasons can be an empty bios battery or a malicious ntp server
there are many other reasons but i think those are the most useful ones. the malicious ntp server could unnecessarily scare people however if its actually happening its very important for the user to know that time is a security relevant topic.
log_warn(LD_GENERAL, "Your system clock has been set back in time. " "Tor needs an accurate clock to know when the consensus " "expires. You might have an empty clock battery or bad NTP " "server. Clock time is %s, state file time is %s.", now_str, last_written_str);
Now that I've read connection_dir_client_reached_eof(), where we also warn about inaccurate clocks, I think it would be nice to make both messages consistent.
We could also refactor the message generation so that it's in a common function.
Here's the current code from connection_dir_client_reached_eof():
log_fn(trusted ? LOG_WARN : LOG_INFO, LD_HTTP, "Received directory with skewed time (server '%s:%d'): " "It seems that our clock is %s by %s, or that theirs is %s. " "Tor requires an accurate clock to work: please check your time, " "timezone, and date settings.", conn->base_.address, conn->base_.port, delta>0 ? "ahead" : "behind", dbuf, delta>0 ? "behind" : "ahead");
Trac: Keywords: N/Adeleted, easy added Status: closed to reopened Priority: normal to trivial Resolution: implemented toN/A