aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random/randomdev_soft.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r249631Andrey A. Chernov2013-04-261-0/+2
| | | | | | | | | | Attempt to mitigate poor initialization of arc4 by one-shot reinitialization from yarrow right after good entropy is harvested. Approved by: secteam (delphij) Notes: svn path=/stable/9/; revision=249915
* MFC r247334:Xin LI2013-03-011-1/+1
| | | | | | | | | | | | Correct a typo introduced in r153575, which gives inverted logic when handling blocking semantics when seeding. PR: kern/143298 Submitted by: James Juran <james juran baesystems com> Reviewed by: markm Notes: svn path=/stable/9/; revision=247511
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909
* There is rubbish hereMark Murray2009-05-251-10/+7
| | | | | | | | It is time to take it out Now it is cleaner Notes: svn path=/head/; revision=192774
* Make sure arc4random(9) is properly seeded when /etc/rc.d/initrandom returns.Colin Percival2008-11-241-3/+23
| | | | | | | | | Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-08:11.arc4random Notes: svn path=/head/; revision=185254
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-1/+1
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Don't save SYSCTL_ADD_*() results in a local variable just to throw themRobert Watson2007-05-281-15/+9
| | | | | | | | | | | away; preserve the ones that are needed for further calls in the init function and ignore the rest entirely. Found with: Coverity Prevent(tm) CID: 563 Notes: svn path=/head/; revision=170067
* Use pause() rather than tsleep() on stack variables and function pointers.John Baldwin2007-02-271-1/+1
| | | | Notes: svn path=/head/; revision=167086
* Change msleep() and tsleep() to not alter the calling thread's priorityJohn Baldwin2006-04-171-4/+2
| | | | | | | | | | | | | | | if the specified priority is zero. This avoids a race where the calling thread could read a snapshot of it's current priority, then a different thread could change the first thread's priority, then the original thread would call sched_prio() inside msleep() undoing the change made by the second thread. I used a priority of zero as no thread that calls msleep() or tsleep() should be specifying a priority of zero anyway. The various places that passed 'curthread->td_priority' or some variant as the priority now pass 0. Notes: svn path=/head/; revision=157815
* Remove GIANT from device random.Paul Saab2005-12-201-0/+42
| | | | | | | Submitted by: ups Notes: svn path=/head/; revision=153575
* Revert to the more correct array size, and correct a KASSERT toMark Murray2005-03-291-2/+2
| | | | | | | | | | | only allow proper values. ENTROPYSOURCE is a maxval+1, not an allowable number. Suggested loose protons in the solution: phk Prefers to keep the pH close to seven: markm Notes: svn path=/head/; revision=144291
* Fix off-by-one (too little!) array size problem.Poul-Henning Kamp2005-03-181-1/+1
| | | | | | | Detected by: Coverity (ID#661) Notes: svn path=/head/; revision=143793
* Check O_NONBLOCK not IO_NDELAY.Poul-Henning Kamp2004-12-221-1/+0
| | | | | | | Don't include vnode.h Notes: svn path=/head/; revision=139194
* Don't change the priority to PUSER when sleeping, just keep the currentJohn Baldwin2004-11-051-2/+4
| | | | | | | priority. Notes: svn path=/head/; revision=137276
* (1) Move from O(n) list copies to O(1) list concatenation, which isRobert Watson2004-11-031-14/+11
| | | | | | | | | | | | | | supported for STAILQ via STAILQ_CONCAT(). (2) Maintain a count of the number of entries in the thread-local entropy fifo so that we can keep the other fifo counts in synch. MFC after: 3 weeks MFC with: randomdev_soft.c revisions 1.5 and 1.6 Suggested by: jhb (1) Notes: svn path=/head/; revision=137152
* Assert that the entropy source category provided by a caller submittingRobert Watson2004-10-121-0/+6
| | | | | | | | entropy is valid, as an invalid source will cause dereferencing of an array of queues to an incorrect memory location. Notes: svn path=/head/; revision=136434
* Modify entropy harvesting locking strategy:Robert Watson2004-10-091-50/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Trade off granularity to reduce overhead, since the current model doesn't appear to reduce contention substantially: move to a single harvest mutex protecting harvesting queues, rather than one mutex per source plus a mutex for the free list. - Reduce mutex operations in a harvesting event to 2 from 4, and maintain lockless read to avoid mutex operations if the queue is full. - When reaping harvested entries from the queue, move all entries from the queue at once, and when done with them, insert them all into a thread-local queue for processing; then insert them all into the empty fifo at once. This reduces O(4n) mutex operations to O(2) mutex operations per wakeup. In the future, we may want to look at re-introducing granularity, although perhaps at the granularity of the source rather than the source class; both the new and old strategies would cause contention between different instances of the same source (i.e., multiple network interfaces). Reviewed by: markm Notes: svn path=/head/; revision=136338
* Perform a lockless read to test whether an entropy havesting fifo isRobert Watson2004-08-111-0/+4
| | | | | | | | | | | | | full, avoiding the cost of mutex operations if it is. We re-test once the mutex is acquired to make sure it's still true before doing the -modify-write part of the read-modify-write. Note that due to the maximum fifo depth being pretty deep, this is unlikely to improve harvesting performance yet. Approved by: markm Notes: svn path=/head/; revision=133465
* Start the entropy device insecure/unblocked. I'll be handing overMark Murray2004-07-181-2/+2
| | | | | | | | | | responsibility for critical randomness requirements (like sshd) to rc.d/* Requested by: many Notes: svn path=/head/; revision=132346
* Default to harvesting everything. This is to help give a fasterMark Murray2004-04-161-3/+3
| | | | | | | | startup. harvesting can be turned OFF in etc/rc.d/* if it is a burden. Notes: svn path=/head/; revision=128320
* Reorganise the entropy device so that high-yield entropy sourcesMark Murray2004-04-091-0/+369
can more easily be used INSTEAD OF the hard-working Yarrow. The only hardware source used at this point is the one inside the VIA C3 Nehemiah (Stepping 3 and above) CPU. More sources will be added in due course. Contributions welcome! Notes: svn path=/head/; revision=128059