[ntp:hackers] Non-monotonic time on NT

Terje Mathisen terje.mathisen at hda.hydro.com
Mon May 14 23:44:13 PDT 2007


hackers-bounces+terje.mathisen=hda.hydro.com at support.ntp.org wrote:
> David L. Mills wrote:
>> Terje,
>>
>> Can a Windows userland program read the TSC directly? I know the
>> equivalent PCC on the Alpha can.
>>
>> Dave
> 
> Dave,
> 
> User-mode Windows programs can include the RDTSC instruction and return a 
> correct result without requiring any special OS configuration.
> 
> I would be interested to know what special OS configuration Warner 
> believes is required.

There is a cpu control bit, only settable in kernel mode, which can 
_disable_ the RDTSC opcode, but by default this bit is cleared, and not 
OS has ever enabled it, afaik.

The disable bit was added for really paranoid people who worry about 
using a high res timer as a hidden back channel, and we've recently seen 
that you can indeed use this from a usermode process to determine the 
RSA key used by a different server process for SSL/SSH etc.

Anyway, the solution to this particular problem is two-fold:

a) Make all crypto code timing-independent of the actual key.

b) Don't allow non-trusted processes on your server.

Terje

-- 
- <Terje.Mathisen at hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"


More information about the hackers mailing list