⬢ DragonFlyBSD Kernel Audit
DF-2822 / sourcenote.txt
← back to finding ↓ download raw
Line-accurate confirmation (boot-window bug; window currently empty
of RNG consumers, so no runtime demo is possible without re-ordering
SYSINITs):
sys/platform/pc64/x86_64/machdep.c:2777  rand_initialize()  (early,
   ncpus==1 -> csprng_pcpu = &csprng_boot, ONE struct)
sys/kern/kern_nrandom.c:562  SYSINIT(rand1, SI_BOOT2_POST_SMP,
   SI_ORDER_SECOND, rand_initialize)  (real array only here)
sys/kern/kern_nrandom.c:697  state = &csprng_pcpu[mycpu->gd_cpuid]
   (unclamped)
sys/kern/kern_nrandom.c:659  same in add_buffer_randomness_src PCPU branch
Between SI_BOOT2_START_APS (0x1a60000) and SI_BOOT2_POST_SMP
(0x1cc0000), ncpus>1 while csprng_pcpu aliases the single-element
csprng_boot: any early RNG consumer on cpu>1 addresses .bss past
csprng_boot and spin_locks/mutates it (silent corruption). Every
current call site's SYSINIT ordering was checked in pass 2; the fix
gates the indexing.