Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
random: always mix cycle counter in add_latent_entropy()
add_latent_entropy() is called every time a process forks, in kernel_clone(). This in turn calls add_device_randomness() using the latent entropy global state. add_device_randomness() does two things: 2) Mixes into the input pool the latent entropy argument passed; and 1) Mixes in a cycle counter, a sort of measurement of when the event took place, the high precision bits of which are presumably difficult to predict. (2) is impossible without CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y. But (1) is always possible. However, currently CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n disables both (1) and (2), instead of just (2). This commit causes the CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n case to still do (1) by passing NULL (len 0) to add_device_randomness() when add_latent_ entropy() is called. Cc: Dominik Brodowski <[email protected]> Cc: PaX Team <[email protected]> Cc: Emese Revfy <[email protected]> Fixes: 38addce ("gcc-plugins: Add latent_entropy plugin") Signed-off-by: Jason A. Donenfeld <[email protected]>
- Loading branch information