scslab/lio — pull request #21 by deian (2012-11-29 23:27:39+00:00)
Title: 7.4 support, rm getCurrentTime

* Update to work with 7.4.2
* WIP: semantics in Ott
* `getCurrentTime` can be used to leak information by internalizing the
external timing channel. Moreover, unless we loop forever in forkLIO
this attack is particularly easy. Here is a contrived and simplified
idea behind the attack (can be carried out without yield, and will
need some more statistical samples):

```haskell
t0 <- getCurrentTime
yield
t1 <- getCurrentTime
let nr_threads = t1 -t0
forkLIO $ if someSecret
then forM_ [1..100000] $ const $ forkLIO ...
else return ()

t0' <- getCurrentTime
yield
t1' <- getCurrentTime
let nr_threads' = t1' -t0'
secret = nr_threads' > nr_threads
```