I'm reading https://lwn.net/SubscriberLink/802360/06e2457983b56edb/ … and facepalming. There is so much wrong here I don't even know where to start.
-
Show this thread
-
You can get entropy out of *asynchronous clocks*. Anything else is just a shitty hash function over other entropy inputs, if any, which you may as well try to collect directly.
2 replies 0 retweets 13 likesShow this thread -
So the code uses the TSC and races it against a timer, which uses the system clocksource. Guess what the system clocksource is on any modern PC? $ cat /sys/bus/clocksource/devices/clocksource0/current_clocksource tsc


1 reply 0 retweets 10 likesShow this thread -
Might be the LAPIC timer for events, but really, who says that stuff isn't running off of a synchronized clock? You'd have had better luck back in the days of the PIT timer, that *definitely* had its own crystal.
1 reply 0 retweets 3 likesShow this thread -
Then there's embedded systems which might have a grand total of one (1) quartz crystal.
1 reply 0 retweets 4 likesShow this thread -
And then the code starts with this gem: http://stack.now = random_get_entropy(); /* Slow counter - or none. Don't even bother */ if (http://stack.now == random_get_entropy()) return;
1 reply 0 retweets 3 likesShow this thread -
Challenge question: what happens when a "slow counter" just so happens to tick between those two calls? Yeah. You need to check 3 times, not 2 (assuming no IRQs to arbitrarily delay the check). And even then it's crude.
1 reply 1 retweet 7 likesShow this thread -
The thing is, yes, you can get useful randomness from interesting places in most platforms, but you need to *know the platform*. This hack, well, it's probably going to give you just about enough entropy in 90% of cases. The other 10%? Pray.
1 reply 1 retweet 17 likesShow this thread -
Replying to @marcan42
But isn't that's the whole point of this backup facility: to jump in when no other, more platform-specific facility does it smarter?
1 reply 0 retweets 0 likes
Adding faketropy where none was there previously just masks lack of entropy problems and will result in people shipping more vulnerable systems because nobody will notice until everyone's got your private keys.
-
-
Replying to @marcan42
Oh, I see, asynchronous clocks means multiple concurrent clocks, then it all makes sense. Yeah, the only good fallback is to block, or crash.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.