summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2011-05-27Fix the return values from pipe_kqfilter - kqfilters should return anNicholas Marriott
errno not 0/1. ok guenther
2011-05-24Reimplement uvm/uvm_map.Ariane van der Steldt
vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
2011-05-20Avoid panic'ing on a bad pointer passed in by callers of msgsnd;Bret Lambert
uiomove() will do the right thing in that case. "This fix is right" kettenis@
2011-05-17Ban passing of kqueue descriptors via UNIX domain sockets. Currently,Philip Guenthe
they're tightly bound to struct filedesc, leading to NULL derefs during exit1(). ok henning@, millert@, kettenis@
2011-05-10tweak timeout_del so it can tell the caller if it actually did remove aDavid Gwynne
timeout or not. without this it is impossible to tell if the timeout was removed or if it is just about to run. if the caller of timeout_del is about to free some state the timeout itself might use, this could lead to a use after free. now if timeout_del returns 1, you know the timeout wont fire and you can proceed with cleanup. how you cope with the timeout being about to fire is up to the caller of timeout_del. discussed with drinking art and art, and most of k2k11 ok miod@
2011-05-08because bufs now come out of a pool rather than a global list of staticlyDavid Gwynne
allocated structs, they wont be shared. we dont have to do the silly B_WANTED dance anymore. get rid of a bunch of comments that talk about how we're stealing from the swapper, which is a lie now. tweaks from oga@ scrutiny by matthew@ ok miod@ oga@ thib@ beck@
2011-05-04Collapse m_pullup and m_pullup2 into a single function, as they'reBret Lambert
essentially identical; the only difference being that m_pullup2 is capable of handling mbuf clusters, but called m_pullup for shorter lengths (!). testing dlg@ ok claudio@
2011-05-03spacesMarco Peereboom
2011-05-02recognize SO_RTABLE socket option at the SOL_SOCKET level;Mike Belopuhov
discussed with and ok claudio
2011-04-28spacesMarco Peereboom
2011-04-26Allow the root device to be identified via its disklabel UID.Joel Sing
ok deraadt@ marco@ krw@
2011-04-19Put splice cleanup code into a common function sounsplice().Alexander Bluhm
ok claudio@
2011-04-18Revert the sigacts diff: NFS can apparently retain pointers to processesPhilip Guenthe
until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
2011-04-18Put back the change of pool and malloc into the new km_alloc(9) api.Artur Grabowski
The problems during the hackathon were not caused by this (most likely). prodded by deraadt@ and beck@
2011-04-16Use 'CLR(<buf>->b_flags, B_READ | B_WRITE | B_DONE)' regardless ofKenneth R Westerback
what the previous IO was. Less chance of copy and paste errors. Suggested by miod@.
2011-04-15In days of yore one could arbitrarily whack buffer flags. Those daysKenneth R Westerback
are past. Use CLR() and SET() to modify necessary flags while leaving the flags used by the buffer cache in peace. Should make bufcache code much less confused about the state of the bufs used in reading/writing disklabels. Other such flag abuses no doubt await a visit. Errors in original diff found by miod@. ok beck@ deraadt@
2011-04-15Correct the sharing of the signal handling state: stuff that shouldPhilip Guenthe
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
2011-04-11Move the DDB includes up in the file so that the m_print() prototype isClaudio Jeker
defined in all of uipc_mbuf.c. I use this function a lot for quick printf debugging.
2011-04-10Backout m_split_mbuf() from revision 1.150. It seems that m_split()Alexander Bluhm
got broken. Most /usr/src/regress/sys/kern/splice/args-oobinline-* regression tests fail when they split an mbuf at out-of-band data. ok claudio@, deraadt@
2011-04-07Revert previous diff decrementing bcstats.numbufpages here. This functionBob Beck
does not do what it purports to do, it shrinks mapping, not allocation, as the pages have already been given away to other buffers. This also renames the function to make this a little more obvious and art should not name funcitons ok thib@, art@
2011-04-07merge vfs_conf.c and vfs_init.c and retire vfs_conf.c;Thordur I. Bjornsson
The contents belong togather a long with other crud, that should get moved at some point. ok deraadt@, miod@
2011-04-06Backout the uvm_km_getpage -> km_alloc conversion. Weird things are happeningArtur Grabowski
and we aren't sure what's causing them. shouted oks by many before I even built a kernel with the diff.
2011-04-05fix nasty buffer cache bug where we could forget about pages shrunk off of aBob Beck
buffer as the result of bread_cluster. ok art@ thib@
2011-04-05- use nitems() no binary change on amd64Jasper Lievisse Adriaanse
"reads OK" claudio@
2011-04-05Remove portalfs.Thordur I. Bjornsson
While it is a terribly cool idea, it's just awful and since noone has stepped up to the plate to keep it up with the current vop state, retire it to the attic. ok krw@, deraadt@, guenther@, miod@. comments from jmc@
2011-04-05Every single vop_default is set to eopnotsupp, so retire itThordur I. Bjornsson
and return EOPNOTSUPP directly from the VOP_* functions. Filesystems should, at some point fill in every function in the vop_default struct so we can get rid of the 'if' statements in VOP_*.
2011-04-05Push COMPAT_FREEBSD in front of a whale. Buggy, out of date, noPhilip Guenthe
one has been weeding it, and it makes life harder. Toasts of Brennivin for its passing from many; diff ok henning@
2011-04-05Passing M_WAITOK to mbuf functions is supposed to be a contract betweenBret Lambert
the caller and the function that the function will not fail to allocate memory and return a NULL pointer. However, m_dup_pkthdr() violates this contract, making it possible for functions that pass M_WAITOK to be surprised in ways that hurt. Fix this by passing the wait flag all the way down the functions that actually do the allocation for m_dup_pkthdr() so that we won't be surprised. man page update forthcoming ok claudio@
2011-04-05 - Change pool constraints to use kmem_pa_mode instead of uvm_constraint_rangeArtur Grabowski
- Use km_alloc for all backend allocations in pools. - Use km_alloc for the emergmency kentry allocations in uvm_mapent_alloc - Garbage collect uvm_km_getpage, uvm_km_getpage_pla and uvm_km_putpage ariane@ ok
2011-04-04both m_inject() and m_split() reached a point at which they neededBret Lambert
to cleave a single mbuf in twain, but managed to fail in divergent and horrible ways in doing so in anything resembling a sane manner introduce m_split_mbuf() and remake the previous into wrappers around that pounded by phessler@ ok claudio@
2011-04-04Correctly inherit and set the watermarks on socketbuffers.Claudio Jeker
This fixes the NFS problems reported on the mailing list and ensures that accepted sockets have correct socketbuffer setting. OK blambert@, henning@
2011-04-04Plug mbuf leaks in SO_PEERCRED by not double allocating mbufs intoClaudio Jeker
the same variable. Leak found with dlg's magic mbuf leakage finder. OK henning@, deraadt@
2011-04-04Move P_EXEC flag from struct proc to process, so that setpgid() willPhilip Guenthe
fail regardless of which rthread calls execve() ok blambert@
2011-04-04syncTheo de Raadt
2011-04-04COMPAT_O47 (kernel getpeereid, which was replaced by libc getpeereid)Theo de Raadt
can go away ok guenther
2011-04-04sysctl kern.pool_debug=0 will disable POOL_DEBUG on the fly (still defaultsTheo de Raadt
to on, if POOL_DEBUG is compiled in, so that boot-time pool corruption can be found. When the sysctl is turned off, performance is almost as as good as compiling with POOL_DEBUG compiled out. Not all pool page headers can be purged of the magic checks. performance tests by henning ok ariane kettenis mikeb
2011-04-04If the socket was half closed then don't let userland change theClaudio Jeker
socketbuffer size of the closed side since on half close the high watermark was set to 0. OK blambert@
2011-04-03Helper functions for suspend.Ariane van der Steldt
Allow reclaiming pages from all pools. Allow zeroing all pages. Allocate the more equal pig. mlarking@ needs this. Not called yet. ok mlarkin@, theo@
2011-04-03Allow kernel printfs to go to console if in ddb instead of being redirectedDale Rahn
to xconsole. ok deraadt@ guenther@
2011-04-03Move PPWAIT flag from struct proc to process, so that rthreads inPhilip Guenthe
a vforked child behave correctly. Have the parent in a vfork() wait on a (different) flag in *its* process instead of the child to prevent a possible use-after-free. When ktracing the child return from a fork, call it rfork if an rthread was created. ok blambert@
2011-04-02The dma pools need to be IPL_VMTheo de Raadt
ok dlg
2011-04-02Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, soPhilip Guenthe
that you can't evade the checks by doing the dirty work in an rthread ok blambert@, deraadt@
2011-04-02Constrain the buffer cache to use only the dma reachable region of memory.Bob Beck
With this change bufcachepercent will be the percentage of dma reachable memory that the buffer cache will attempt to use. ok deraadt@ thib@ oga@
2011-04-02remove the vnode_if.* files, as they are now totallyThordur I. Bjornsson
obsolete. the move to vfs_vops.c is here to stay, so they are pointless.
2011-03-19Repair spoofing. We want to start at 'i', not 'j'.Kenneth R Westerback
Spotted by deraadt@.
2011-03-17Uncommitted bits. Spotted by deraadt@, who theorizes I have insuffientKenneth R Westerback
sushi level.
2011-03-17make more dma pools -- all the way up to 64K. at least the scsiTheo de Raadt
SCIOCCOMMAND wants a dma'able object that big. should we handle this another way, by handling that data in a buf? ok krw
2011-03-14Don't confuse limiting spoofed partitions with limiting how manyKenneth R Westerback
EBRs to follow looking for the OpenBSD partition. Just stop spoofing if necessary.
2011-03-14When a process reads from a spliced socket that already got anAlexander Bluhm
end-of-file but still has data in the receive buffer, soreceive() should block until all data has been moved. To make kqueue work with socket splicing, it has to report spliced sockets as non-readable. ok deraadt@
2011-03-12There existed a race when a process was trying to read from a splicedAlexander Bluhm
socket. soreceive() releases splsoftnet for uiomove(). In that moment, somove() could pull the mbuf from the receive buffer. After that, soreceive removed the mbuf again. The corrupted length accounting resulted in a panic. The fix is to block read calls in soreceive() until splicing has been finished. just commit deraadt@