3 ms·
I had this exact same question. I guess you can make sure the code that checks and reads from the rng state can't fork in the middle of it (or call out to user
by infogulch 9y ago
I had this exact same question. I guess you can make sure the code that checks and reads from the rng state can't fork in the middle of it (or call out to user code). But that only helps in the single-threaded case, what happens if you have another thread that is accessing it at the same time as the fork? Even if you check before and after, the initialized bool could be set again by the time you check after even though you just read a bunch of zeros.
A rng-per-thread combined with initialization check before and after might cover all the cases I think...
- revelation 9y agoFrom what I can tell in their s2n code, the canary was/is already TLS.
- deleted 9y ago[deleted]