summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2014-02-12Eliminate the exit sig handling, which was only invokable via thePhilip Guenther
Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@ confirms Opera runs in compat without this, so out it goes; one less hair to choke on in kern_exit.c ok tedu@ pirofti@
2014-02-10arc4random_uniform() returns a value strictly less than its argument; fixPhilip Guenther
arithmetic so that PID_MAX can be reached. ok otto@ zhuk@ miod@
2014-02-09Fix the lock order reversal problem in the code that stops tracedMark Kettenis
multi-threaded processes when they receive a signal: 1. Make the parent of the process (the tracer) wait for all threads to be stopped (in wait4(2)) instead of the thread that received the signal. This prevents us from calling tsleep(9) recursively. 2. Assume that we already hold the kernel lock if the P_SINTR flag is set (just like we already assumed we were holding the scheduler lock) and don't try to grab it again. This should fix the panic that many people reported when debugging multi-threaded programs with gdb(1). ok & lots of help from guenther@
2014-02-09regenPhilip Guenther
2014-02-09nanosleep() isn't actually NOLOCK safe yet: tsleep() still requires kernelPhilip Guenther
lock for PCATCH and ktrace(CSW) handling ok kettenis@
2014-02-01Remove some of the excessive cache and TLB flushing going on duringMike Larkin
hibernate unpack - these were added a while ago when we were fighting different issues that have now been solved. Tested by myself and dcoppa on a variety of machines
2014-01-30Simplyfy adjtime(2) by keeping track of the adjustment as a number ofMark Kettenis
microsecond in a 64-bit integer. Fixes the issue where ntpd loses sync because the struct timeval currently used to hold the adjustment is not properly normalized after the changes guenther@ made. ok guenther@, millert@
2014-01-25get rid of the kernel high and low water marks for pages and replace withBob Beck
a single target of used pages in the cache - so we don't to a ton of work throwing away pages sporadically while holding the biglock - noticed by dlg. ok dlg@ deraadt@
2014-01-24When a disklabel is read from a MBR partitioned disk, don'tKenneth R Westerback
replace the OpenBSD bounds with the A6 MBR partition limits. Thus preserving any changes the user makes with the 'b' command in disklabel. Reported, tested & ok blambert@, ok deraadt@
2014-01-24Copy timespecs member by member in fo_stat callback functions, to avoidPhilip Guenther
leaking values in the padding bytes on LP64. Also, vn_stat() was lacking the zero-fill to clean its padding. ok kettenis@ deraadt@ phessler@
2014-01-24exit1() needs to do a final aggregation of the thread's [us]ticksPhilip Guenther
and runtime to the process totals. Also, add ktracing of struct rusage in wait4() and getrusage(). problem pointed out by tedu@ ok deraadt@
2014-01-23msleep() with a NULL mtx argument is a programming error.Philip Guenther
ok matthew@ phessler@ dlg@
2014-01-23Waiting on a condition without a lock is an error: you need *some* lockPhilip Guenther
to guarantee there isn't a window in which you can lose a wakeup. The exception for tsleep() is when it's just being used to sleep for a period of time, so permit that too. ok jsing@ deraadt@
2014-01-23Delete spurious if statement.Kenneth R Westerback
ok phessler@ deraadt@ jsing@ guenther@
2014-01-22Write disklabel in correct spot on devices with non-512-byte sectors.Kenneth R Westerback
For now and until 5.5 is cut, also read from current/incorrect spot so people don't immediately lose their existing disklabels on such devices. Problem spotted by David Vasek.
2014-01-22Delete casts in assignments to void* and passed void* arguments.Philip Guenther
bcopy() can be memcpy() because target is freshly malloced. &array[n] is simpler than (char*)array + n*sizeof(array[0]) ok tedu@
2014-01-22timeval, timespec, and itimerval have padding on many archs. If we'rePhilip Guenther
going to copyout one, memset the structure and then set it member by member. sys_adjtime() does that on copyin instead, as it already has to munge the members as it goes. ok deraadt@
2014-01-21Don't leak kernel stack in timeval padding in getsockopt(SO_{SND,RCV}TIMEO)Philip Guenther
ok mikeb@ deraadt@
2014-01-21Add extent_alloc_subregion_with_descr(9) which allows the caller to provideMark Kettenis
a region descriptor such that the extent manager doesn't need to call malloc(9). ok miod@, deraadt@
2014-01-21Setting p->p_p to NULL when it's still running isn't safe for statclock().Philip Guenther
It was just for cleanliness, so be a little dirty ok krw@, who managed to convince his clock to fire in the gap
2014-01-21bzero -> memsetTed Unangst
2014-01-20Threads can't be zombies, only processes, so change zombproc to zombprocess,Philip Guenther
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
2014-01-20Fix commentPhilip Guenther
2014-01-20Move p_textvp from struct proc to struct process so that the exit codePhilip Guenther
can be further simplified. ok kettenis@
2014-01-19Refactor rnd startup so arc4random/arc4random_buf can create a chacha stateTheo de Raadt
on first call, very early on, from boot-supplied entropy, then feed from that. Later when we have more subsystems ready, the main() can properly initialize the entropy-driven model. Lots of discussion with mikeb. ok kettenis markus mikeb
2014-01-19insane typoTheo de Raadt
2014-01-19oops, forgotten partTheo de Raadt
Initialize ci_randseed better using arc4random() + a trick. Remove the libkern srandom() API since it is not suitable for this use. ok kettenis miod
2014-01-19Remove max_datalen. It is only used once an can be replaced easily withClaudio Jeker
MHLEN - max_hdr in that place. OK mikeb@
2014-01-19With the earlier initialization of the random subsystem, random_hostseed()Theo de Raadt
is no longer providing significant value. The random subsystem is in pretty good state, and moments later userland will feed the dmesg. ok jsing
2014-01-19We can call random_start() immediately after cpu_startup, that is theTheo de Raadt
point at which everything it does is safe, including msg buffer access. ok kettenis jsing
2014-01-14Typo in a printf, should be 'bytes' not 'blocks'Mike Larkin
2014-01-13Return the poison value in poison_check() and not the modified value.Martin Pieuchot
ok tedu@
2014-01-11When I created UDP socket splicing, I added the goto nextpkt loopAlexander Bluhm
to splice multiple UDP packets in the m_nextpkt list. Some profiling with TCP splicing showed that checking so_rcv.sb_mb is wrong. It causes several useless runs through the loop. Better check for nextrecord which contains the original m_nextpkt value of the mbuf. OK mikeb@
2014-01-10Let "ddb show mbuf" print all mbuf fields in a consistent way. MoveAlexander Bluhm
bit field names into the header file below the definitions to keep them in sync. OK mikeb@ mpi@
2014-01-01copyright++Federico G. Schwindt
2013-12-28oops, the fallback stack protector code must handle 64-bit guardsTheo de Raadt
spotted by kettenis
2013-12-28change the stack protector guard into a long word (removing the old legacyTheo de Raadt
compat pointed out by miod), and place it inside the ELF .openbsd.randomdata segment. Inside main(), only re-initialize the guard if the bootblocks failed to initialize it for us.
2013-12-28We can initialize the srandom/random system earlier from arc4random,Theo de Raadt
and do not need microtime.
2013-12-28We can random_start() earlier (not that it does too much) and callTheo de Raadt
arc4random() much earlier. Leading to random pids for anything besides 0 and 1.
2013-12-24get rid of if (timeout_pending()) timeout_del(). this is racy. anyDavid Gwynne
conditionals you did on timeout_pending can now be done on timeout_del now that it returns what it did. ok and a very good fix from kettenis@
2013-12-24rename local ticks to nticks to avoid aliasing global. ok krwTed Unangst
2013-12-16Restore TIOCGSID ioctl that was removed along with the 4.3BSD tty(4)Todd C. Miller
compat. This will be used to implement tcgetsid() in the future. OK kettenis@ guenther@
2013-12-13Remove the 4.3BSD tty(4) compatibility shims. RIP. ok millert@Christian Weisgerber
2013-12-12Add db_vprintf(), and then use it in ACPI's db_disprint() instead ofPhilip Guenther
formatting into a local buffer. ok miod@
2013-12-12printf(variable) --> printf("%s", variable)Philip Guenther
ok deraadt@
2013-12-11Fix typo; that teaches me to steal other people's diffs!Mark Kettenis
2013-12-10dead assignment; from david hill, ok claudioMike Belopuhov
2013-12-10Add infrastructure to create un-biglocked task queues. Stolen from blambert@Mark Kettenis
who is slacking to much. ok dlg@
2013-12-09use a separate task queue for sensors;Mike Belopuhov
with input from and ok kettenis, deraadt
2013-12-09Don't keep removed files (B_INVAL bufs) in the buffer cache. Free buffersBob Beck
once brelse() is called and the buffer is B_INVAL. ok jsing@ krw@