[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kernel/3711: arc4random in kernel init causes uninitialised use of timeout_add and panic w/ DIAGNOSTIC



sys/net80211 initialisation uses arc4random for setup of an IV for WEP. 

Either this is a bad design (i.e. it assumes that there is safe strong
random that can be called from a device pci attach methods), or it's a good
design with flawed implementation (i.e. should be using random() rather than
arc4random()) or it's a good design with good implementation (i.e. it's a
bug that arc4random() panics). 

What do you experts recommend I do ? 

(a) is there a safe way to get good randomness during pci derived attached
methods, if so, how ?
(b) if not, then obviously I need to fix the driver, but you'd think that
the kernel was tighter and would panic in arc4random explictly rather than
implicit failure through a secondary fault (in timeout_add). 





regards,
 
Matthew Gream

London W2 4PS
+44 77 6969 0248
matthew.gream@pobox.com
http://matthewgream.net


-----Original Message-----
From: Michael Shalayeff [mailto:mickey@lucifier.net] 
Sent: 14 March 2004 09:10
To: Matthew Gream
Cc: 'Ted Unangst'; bugs@cvs.openbsd.org
Subject: Re: kernel/3711: arc4random in kernel init causes uninitialised use
of timeout_add and panic w/ DIAGNOSTIC

Making, drinking tea and reading an opus magnum from Matthew Gream:
> I ported a driver from netbsd that did this; is there a more 
> acceptable way to obtain random() data in methods called from pci attach ?

which driver?
why do you need strong random there that early anyway?

cu

> -----Original Message-----
> From: Ted Unangst [mailto:tedu@zeitbombe.org]
> Sent: 13 March 2004 19:39
> To: Matthew
> Cc: bugs@cvs.openbsd.org
> Subject: Re: kernel/3711: arc4random in kernel init causes 
> uninitialised use of timeout_add and panic w/ DIAGNOSTIC
> 
> On Sat, 13 Mar 2004, Matthew wrote:
> 
> >         Using arc4random before randomattach, e.g. from a PCI 
> > attach,
> results in arc4maybeinit being
> > 	called with arc4random_initialized not set, resulting in 
> > timeout_add
> on uninitialised
> > 	arc4_timeout, which panics in DIAGNOSTIC. Found in 3.3, but still
> present in HEAD.
> > >How-To-Repeat:
> >         choose good pci_attach and use arc4random from dev/rndvar.h 
> > &
> dev/rnd.c
> >         build DIAGNOSTIC kernel
> >         reboot and get nice panic from kern_timeout.c:163.
> 
> why are you doing this?
> 
> 
> --
> desire is not an occupation
> 


-- 
    paranoic mickey       (my employers have changed but, the name has
remained)