summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2014-06-15Use sizeof(struct file *) consistently for memcpy()'ing fd_ofiles.Matthew Dempsky
Pointed out by Jean-Philippe Ouellet.
2014-06-15Fix a few format string bugs with -DDEBUGStefan Fritsch
2014-06-14Rather than truncating KERN_ARND requests silently, return EINVALTheo de Raadt
ok miod
2014-06-14temporarily (maybe 3 weeks?) crank KERN_ARND maximum buffer from 256Theo de Raadt
to 512, to make it easier for people to build to -current. ok miod
2014-06-14syncTheo de Raadt
2014-06-14Change return value of getentropy() to int 0 for success. MaximumTheo de Raadt
buffersize is enforced strictly, this supplies sufficient entropy payload to act as seed material. Discourage general use of this API, but lock down this function name as the go-to for userland PRNG seeding. Improve documentation. ok miod matthew
2014-06-13syncTheo de Raadt
2014-06-13Add new getentropy() system call. Code and pressure from matthew.Theo de Raadt
I accepted that he's right (again) to seperate this out from heavy sysctl API and this will simply a variety of things. Functionname is not used by anyone in the ports tree, so we guess we can use it. Shocking that no application has a function called this. ok matthew & others who pushed him to start this early on
2014-06-13Instead of updating all the cluster allocation water marks of all theMartin Pieuchot
interfaces when the kernel is livelocked, only do it for the current pool and defer the other updates. This allow us to get rid of an interface list iteration in a critical path. Ridding the libc crank since this change introduce an ABI break. ok claudio@
2014-06-11Fix wait4 to not modify status or rusage if we return 0 because ofMatthew Dempsky
WNOHANG, in accordance with POSIX. Additionally, if rusage is requested but the waited-on process did not terminate, return zero bytes instead of kernel stack garbage. ok deraadt, millert
2014-06-11Add bounds checks for CTL_DEBUG sysctl variable.Matthew Dempsky
2014-06-11Create system taskq ("systqmp") which runs without the kernel lock;Bret Lambert
currently unused. ok dlg@ manpage improvement and ok jmc@
2014-06-08Use memcpy to copy the sogetopt() SO_SPLICE off_t value, for it may not beMiod Vallat
correctly aligned. Similar in spirit to 1.119.
2014-06-06Allocate the struct itty array in ttystats_init() with M_ZERO.Matthew Dempsky
ok millert
2014-06-04While it may be smart to use the radix tree for exports it is not OK toClaudio Jeker
use the domain specific tree initialisation method for this since that one is multipath enabled and assumes that the radix node is part of a struct rtentry. This code uses a different struct and so the multipath modifies wrong fields and breaks stuff in mysterious ways. Since we only support AF_INET here anyway simplify the code and only have one radix_node_head pointer instead of AF_MAX ones. Fixes NFS server issues reported by rpe@, OK rpe@, guenther@, sthen@
2014-05-31Fix a format specifier in a debug printf.Mike Larkin
Noticed by Josh Grosse.
2014-05-30explicit_bzero for clearing stack variables.Ted Unangst
2014-05-29Read MAXPHYS bytes at a time in the hibernate image read, instead ofMike Larkin
PAGE_SIZE bytes. Completes the MAXPHYS optimizations in the read path. with input from guenther@ who suggested a version that was a little easier to understand. Tested on i386 and amd64.
2014-05-29When vmcmd_map_readvn() maps in the page it reads into, it forcesPhilip Guenther
it to be writable but otherwise uses the correct final permissions. Ergo, it only needs to call uvm_map_protect() if the requested permissions didn't include UVM_PROT_WRITE. ok beck@
2014-05-25Handle threaded processes correctly when processing kerninfo status requestsPhilip Guenther
(aka ^T), summing CPU and check runnable/running status of all threads. ok deraadt@
2014-05-25In access(), use the real UID/GID for the path search too.Philip Guenther
ok matthew@
2014-05-21Change use of Z_PARTIAL_FLUSH to Z_SYNC_FLUSH in the hibernate code as perMike Larkin
a warning/comment in zlib.h that Z_PARTIAL_FLUSH "will be removed, use Z_SYNC_FLUSH instead".
2014-05-19consistent use of uint32_t for poison valuesTed Unangst
2014-05-17When looking at another process, use the data from struct processPhilip Guenther
instead of peeking into the thread level ok tedu@
2014-05-15knote_processexit() needs the thread to pass down to FRELE(), so pass itPhilip Guenther
the exiting thread instead of assuming that that's ps_mainproc. Also, panic no matter which thread of init takes it down. ok tedu@
2014-05-15Prefer prsignal() to send process signalsPhilip Guenther
2014-05-15Move from struct proc to process the reference-count-holding pointersPhilip Guenther
to the process's vmspace and filedescs. struct proc continues to keep copies of the pointers, copying them on fork, clearing them on exit, and (for vmspace) refreshing on exec. Also, make uvm_swapout_threads() thread aware, eliminating p_swtime in kernel. particular testing by ajacoutot@ and sebastia@
2014-05-06Include <sys/vmmeter.h> directly instead of relying on it beingMartin Pieuchot
pulled by <uvm/uvm_extern.h> and turn uvm_total() into a private function. The preferred way to get memory stats is through the VM_UVMEXP sysctl(3) since VM_METER is just a wrapper on top of it. In the kernel, use `uvmexp' directly instead of uvm_total(). This change does not remove <sys/vmmeter.h> from <uvm/uvm_extern.h> to give some more time to port maintainers to fix their ports. ok guenther@ as part of a larger diff.
2014-05-04remove some hh and h format specifiersStefan Fritsch
gcc does not like hh in kprintf and it does not make any difference due to integer promotion rules. While there, remove some h's, too. suggested by kettenis@
2014-05-04Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,Philip Guenther
and FORK_SYSTEM as a flag to set them. This eliminates needing to peek into other processes threads in various places. Inspired by NetBSD ok miod@ matthew@
2014-05-04When kern.nosuidcoredump=3, act like =2 but try to dump cores intoTheo de Raadt
the /var/crash/programname/ directory, as root. For instance, # mkdir /var/crash/bgpd/ # chmod 700 /var/crash/bgpd/ # If you skip this step, you are a moron # sysctl kern.nosuidcoredump=3 # bgpd # pkill -ABRT bgpd # ls /var/crash/bgpd/ 14764.core 23207.core 6423.core Of course, in real life the idea is that you don't kill the daemon but it crashes and you collect parallel cores. Careful you don't fill your /var. Further tuneables are being considered. Sorry to be picking on bgpd for this example. I've watched the "too difficult to debug privsep code" angst for far too long. ok guenther
2014-05-03If P_ZOMBIE(pr->ps_mainproc) is true, then (pr->ps_flags & PS_EXITING)Philip Guenther
is, so eliminate the check of the former and instead use the EINVAL error for the latter. Also, consistently check for PS_EXITING before check creds. suggestion to split this from another diff miod@
2014-05-03Move the u-area allocation and pmap-magic logic to its own functionPhilip Guenther
uvm_uarea_alloc() function name from NetBSD; arm testing by miod@
2014-05-01with some random chance, swizzle the current page for the pool to avoidTed Unangst
fully deterministic behavior. ok deraadt
2014-04-26Perform MAXPHYS-sized reads for the chunktable instead of PAGE_SIZE-sizedMike Larkin
reads. Also fix a VA leak in the chunktable read error path.
2014-04-22Remove some altq tentacles.Martin Pieuchot
ok pelikan@, henning@
2014-04-21we'll do fine without casting NULL to struct foo * / void *Henning Brauer
ok gcc & md5 (alas, no binary change)
2014-04-20More dead stores removal in subr_hibernate.cMike Larkin
2014-04-19Dead stores in subr_hibernate.cMike Larkin
2014-04-18Have each thread keeps its own (counted!) reference to the process's ucredsPhilip Guenther
to avoid possible use-after-free references when swapping ids in threaded processes. "Do I have the right creds?" checks are always made with the threads creds. Inspired by FreeBSD and NetBSD "right time" deraadt@
2014-04-17Make sure the original thread is blocked until any other threads arePhilip Guenther
completely detached from the process before letting it exit, so that sleeping in systrace_exit() doesn't reorder them and lead to a panic. Panic reported by Fabian Raetz (fabian.raetz (at) gmail.com) ok tedu@
2014-04-14"struct pkthdr" holds a routing table ID, not a routing domain one.Martin Pieuchot
Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
2014-04-12revert falloc change, as it causes all new processes to get stuck after a whileMarc Espie
(race condition ?) problem noticed by me, aja, sthen, brynet, rpe. vanishing after this revert, okay aja@, sthen@ tedu, you probably want to look into re-checking the fcreate/fpublish addition first, then if it's stable, see about tweaking doopenat ?
2014-04-10pull the bufcache freelist code out into separate functions to allow newTed Unangst
algorithms to be tested. in the process, drop support for unused B_AGE and b_synctime options. previous versions ok beck deraadt
2014-04-07Retire kernel support for SO_DONTROUTE, this time without breakingMartin Pieuchot
localhost connections. The plan is to always use the routing table for addresses and routes resolutions, so there is no future for an option that wants to bypass it. This option has never been implemented for IPv6 anyway, so let's just remove the IPv4 bits that you weren't aware of. Tested a least by lteo@, guenther@ and chrisz@, ok mikeb@, benno@
2014-04-03bcopy -> memcpyTed Unangst
2014-04-03if it's ok to wait, it must also be ok to give the kernel lock. do so.Ted Unangst
(then immediately reacquire it). this has the effect of giving interrupts on other CPUs to a chance to run and reduces latency in many cases. ok deraadt
2014-04-03fix $OpenBSD$, noticed by philipBob Beck
2014-04-03I have discussed these licenses with Poul-Henning Kamp and he has agreed toBob Beck
this license change. We will remember that we all still like beer.
2014-03-31Grab the kernel lock before autoconf. This way device drivers can drop it inMark Kettenis
any context if they feel like it. ok deraadt@, guenther@ (who both suggested we could probably grab it even earlier)