⬢ DragonFlyBSD Kernel Audit
DF-5694 / run.log
← back to finding ↓ download raw
### DF-5694 evidence: in-kernel (KLD) measurements ###
--- /dev/arc4srep (2^20 karc4random64 draws, in-kernel) x2 ---
karc4random64 draws=1048576
top32==0xffffffff: 523487 (0.4992; bug predicts ~0.5000)
byte3>=0x80:       523487 (0.4992)
karc4random64 draws=1048576
top32==0xffffffff: 524342 (0.5000; bug predicts ~0.5000)
byte3>=0x80:       524342 (0.5000)
--- /dev/arc4s64 stream 16MB (k64) ---
k64 words=2097152 top32==0xffffffff: 1049617 (0.500496) byte3>=0x80: 1049617 (0.500496)
--- /dev/arc4s32 stream 64MB (karc4random) chi2 ---
n=67108864 chi2_byte=237.5 (df=255 z=-0.77)
chi2_digraph=65049.4 (df=65535 z=-1.34)
--- /dev/arc4sbuf stream 64MB (karc4random_buf) chi2 ---
n=67108864 chi2_byte=262.1 (df=255 z=+0.31)
chi2_digraph=65429.9 (df=65535 z=-0.29)

### userland exact-source harness (same source, getrandom-seeded) ###
--- bias64 10M draws ---
draws=10000000
P(top32==0xffffffff) = 0.499919  (bug predicts ~0.500000)
P(byte3>=0x80)       = 0.499919  (must be ~0.500000)
P(both)              = 0.499919
vm_map mmap-ASLR addend distribution over 8x4GB buckets (uniform would be 0.125000 each):
  bucket[0] (top 4GB=no ): 0.062511
  bucket[1] (top 4GB=no ): 0.062519
  bucket[2] (top 4GB=no ): 0.062615
  bucket[3] (top 4GB=no ): 0.062511
  bucket[4] (top 4GB=no ): 0.062439
  bucket[5] (top 4GB=no ): 0.062502
  bucket[6] (top 4GB=no ): 0.062474
  bucket[7] (top 4GB=yes): 0.562429
addend min-entropy ~ 32.83 bits (ideal 35.00)
--- race 1000 trials (interleaving invariant-break demo) ---
trials=1000 timed_ordered_bytes=7986 divergent_from_serialized=3946 (49.4%)
cross_consumer_duplicate_words=0
--- stats 256MB (k32+buf) ---
bytes=268435456 chi2_bytefreq=253.5 (df=255, mean=255, sd=22.6, z=-0.07)
chi2_serial=66110.1 (df=65535, mean=65535, sd=362.0, z=+1.59)
--- PATCHED algorithm validation ---
draws=10000000
P(top32==0xffffffff) = 0.000000  (bug predicts ~0.500000)
P(byte3>=0x80)       = 0.500360  (must be ~0.500000)
P(both)              = 0.000000
vm_map mmap-ASLR addend distribution over 8x4GB buckets (uniform would be 0.125000 each):
  bucket[0] (top 4GB=no ): 0.124953
  bucket[1] (top 4GB=no ): 0.125071
  bucket[2] (top 4GB=no ): 0.124793
  bucket[3] (top 4GB=no ): 0.125185
  bucket[4] (top 4GB=no ): 0.125028
  bucket[5] (top 4GB=no ): 0.124974
  bucket[6] (top 4GB=no ): 0.125110
  bucket[7] (top 4GB=yes): 0.124885
addend min-entropy ~ 35.00 bits (ideal 35.00)
--- bias probes 2^32 bytes ---
bytes=4294967296
Pr[Z==0]: exp=16777216 got=16775826 z=-0.34
lag1_repeat: exp=16777216 got=16782027 z=+1.18
lag2_repeat: exp=16777216 got=16780939 z=+0.91
lag3_repeat: exp=16777216 got=16770563 z=-1.63
lag4_repeat: exp=16777216 got=16779944 z=+0.67
lag5_repeat: exp=16777216 got=16779441 z=+0.54
lag6_repeat: exp=16777216 got=16777336 z=+0.03
lag7_repeat: exp=16777216 got=16772375 z=-1.18
lag8_repeat: exp=16777216 got=16770393 z=-1.67
first16k_word_freq chi2=239.7 (df=255, z=-0.68)