CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2017/07/30 15:40:14
Modified files:
sys/dev : rnd.c
Log message:
clang (and newer gcc at high -O) are unaware that objects placed in strange
sections, such as __attribute__((section(".openbsd.randomdata"))), may be
non-zero. In combination with "const" or "static" the compiler becomes even
more sure nothing can influence the object and assumes the value will be 0.
A few optimizations later, a security requirement has been removed.
Until a better annotation arrives in compilers, be warned: Do not mix
const or static with these random objects, you won't get what you want.
Spotted in a regression test by bluhm, long discussion with kettenis.