summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2015-02-07make mq_enlist drop mbufs is the queues length is exceeded.David Gwynne
ok mpi@ claudio@ henning@ and more at s2k15
2015-02-07Preserve a page's worth of random data on hibernate resume. Used to improveMike Larkin
entropy after resuming. Tested on i386 and amd64. ok deraadt@
2015-02-07add ml_filter and mq_filter functions to the mbuf list and queue apis.David Gwynne
this lets you run a filter function against each mbuf on a list or queue. if the filter matches on an mbuf, it can return non-zero to have ml_filter or mq_filter remove the mbuf and return it as part of a chain of mbufs. ok mpi@ claudio@ henning@ and s2k15 generally.
2015-02-07New framework that allows hibernate to pass in entropy from it's freshTheo de Raadt
boot. ok mlarkin
2015-02-06Raise ELF_RANDOMIZE_LIMIT to 64K, so that programs and libraries canTheo de Raadt
legitimately use random section variables without execve failures... Because this section is not demand faulted, yield() every page during the fill otherwise the costs are charged poorly. ok tedu matthew
2015-02-06Fix a hibernate crash on some machines due to unmapping a page thatMike Larkin
may not have been mapped previously (in the failure to hibernate case). Also ensure that the lowmem ptp is mapped in all cases (not just MP). ok kettenis
2015-01-28revert back to initial vnodes again so we can be sure nfs likes itTed Unangst
2015-01-27remove workq code. its been replaced with tasks.David Gwynne
it has been unused since december, and unhooked from the build since christmas. ok krw@
2015-01-27remove the second void * argument on tasks.David Gwynne
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
2015-01-27Require EFT shared objects have a PT_PHDR entry to be consideredKurt Miller
a pie binary. The kernel will now reject executing a typical shared library with EINVAL. This breaks compatibility with initial static pie binaries and requires a recent user-land prior to upgrading. In addition, more fine grained errors can be returned from execve(2) when errors occur while attempting to execute ELF objects. okay guenther@, kettenis@, deraadt@
2015-01-26Move the "stackgap" from the stack into its own page at a random address.Mark Kettenis
This allows us the unmap the initial part of the stack, such that it can't be used as a staging area for ROP (or other) attacks. ok guenther@, tedu@
2015-01-22pool_chk_page iterates over a pages free item lists and checks thatDavid Gwynne
the items address is within the page. it does that by masking the item address with the page mask and comparing that to the page address. however, if we're using large pages with external page headers, we dont request that the large page be aligned to its size. eg, on an arch with 4k pages, an 8k large page could be aligned to 4k, so masking bits to get the page address wont work. these incorrect checks were distracting while i was debugging large pages on landisk. this changes it to do range checks to see if the item is within the page. it also checks if the item is on the page before checking if its magic values or poison is right. ok miod@
2015-01-22bring back r1.80:David Gwynne
pass the size of the softc to free. this time we only dereference the cfattach structure if we actually need it once the refcount has dropped to 0. tested by krw@ who found the original panic r1.80 was backed out for. putting this in again so i can find out when else will break.
2015-01-20Move ps_strings "after" the random stackgap. This makes its location aMark Kettenis
per-process value, and therefpore turns the VM_PSSTRINGS sysctl into a per-process one as well. This gets rid of a pointer to the bottom of the stack at a fixed location. Also clears the road for unmapping the stackgap. ok deraadt@
2015-01-20Missing $OpenBSD$'s.Kenneth R Westerback
ok deraadt@
2015-01-19back it out properlyTheo de Raadt
2015-01-19never tested with a make releaseTheo de Raadt
2015-01-19Oops, missed the new #include when manually applying the diff fromPhilip Guenther
Helg (xx404 (at) msn.com)
2015-01-19Fix bracing in ASSERT_VP_ISLOCKED(vp) macro to not always panic()Philip Guenther
From Helg (xx404 (at) msn.com)
2015-01-19Move doaccept() declaration from its .c file to sys/socketvar.h for usePhilip Guenther
by compat/linux
2015-01-19Delete ABI compat for osockaddr: 20 years and many ABI bumps since sa_len addedPhilip Guenther
ok krw@ bluhm@ deraadt@
2015-01-19SYMLOOP_MAX == MAXSYMLINKS, so use SYMLOOP_MAXTheo de Raadt
2015-01-19pass the size of the softc to free.David Gwynne
ok deraadt@
2015-01-19white space fixes. no binary change.David Gwynne
2015-01-19unneccessary cmask variable; ok guentherTheo de Raadt
2015-01-18Revert 1.166 (but keep the bufq_wait() interface change), for this is wrongMiod Vallat
and the bufq pointer might be NULL at the time it is `saved'. Found the hard way on sparc due to the limited kva, with all disk active processes ending up sleeping on "buf_needva". ok kettenis@ krw@
2015-01-17use NGROUPS_MAXTheo de Raadt
2015-01-16increase namecache to maxvnodes again now that the n^2 loop is no more.Ted Unangst
battle tested by krw
2015-01-16increasing the size of the namecache suddenly made the commentTed Unangst
"This makes the algorithm O(n^2), but do you think I care?" a lot more meaningful, as discovered by krw. fix the loop so it doesn't restart all the time, as it's not necessary. (this was also tried years ago in rev 1.20 and reverted, but that change also introduced pool_put before the namecache was ready to free things. we have been freeing cache entries with pool_put for some time now, so that's been made safe.) ok deraadt krw
2015-01-15The flags variable in shmat was not actually used. We need UVM_FLAG_*Todd C. Miller
flags, not mmap-style flags for UVM_MAPFLAG(). Remove the nonsensical MAP_ANON|MAP_SHARED value and convert MAP_FIXED to UVM_FLAG_FIXED. OK guenther@
2015-01-15Map the sigcode page with MAP_INHERIT_COPY to make sure it isn't shared aterMark Kettenis
a fork. ok deraadt@
2015-01-15Map the sigcode page copy-on-write. This allows userland to put breakpointsMark Kettenis
in the signal trampoline. Solves some long-standing issues with debugging signal handlers in GDB. ok deraadt@
2015-01-13Many architectures call initmsgbuf() really really early, before uvm isMark Kettenis
initialized. Calling malloc(9) at that point is not a good idea. So initialize consbuf later. Fixes dmesg -s on sparc64 (and probably a few other architectures). ok miod@, deraadt@
2015-01-13Add dmesg -s support, to view the output of rc(8) system startup messages.Marco Pfatschbacher
Help and feedback by Theo and Miod. OK deraadt@, manpage-ok jmc@
2015-01-12revert the namecache embiggening since it seems to cause hangs at reboot.Ted Unangst
reported and revert tested by krw
2015-01-12hibernate_suspend() should not pmap_kremove by itself; hibernate_free()Theo de Raadt
must do that. otherwise, pmap_kremove is called twice. i386 in particular does not tolerate that, found by sebastia ok mlarkin kettenis
2015-01-09save the bufq pointer from the buf before we turn it loose so it won'tTed Unangst
change on us. also, remove unused second arg to bufq_wait. from pedro at bitrig via david hill. ok beck kettenis
2015-01-09rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadtTed Unangst
2015-01-08increase namecache size to follow maxvnodes. seems better than desiredvnodes.Ted Unangst
(accuracy of variable names, aside) ok kettenis
2015-01-05splassert on some archs (or just sparc64) check that you're not inDavid Gwynne
an interrupt handler at an ipl level higher than what you're splasserting you should be at. if you think code should be protected by IPL_BIO and its entered from an interrupt handler established at IPL_NET, you have a bug. add some asserts to gets and puts so we can pick those cases up.
2015-01-04back out r1.173, aka the "* 8" diff. it tickles a problem on someDavid Gwynne
landisk machines. we've been unable to figure out due to a lack of hardware (on my part) or time. discussed with and ok miod@
2015-01-04avoid the use of an uninitialised variable in one of the codepaths inJonathan Gray
pool_setlowat() ok dlg@ tedu@
2014-12-31copyright_year=$(date +%Y)Joel Sing
2014-12-30Rework disklabel reading taskq to plug holes pointed out by jsing@.Kenneth R Westerback
Diff from dlg@. ok jsing@
2014-12-29Explicitely include <uvm/uvm_extern.h> in order to build on variable page sizeMiod Vallat
architectures.
2014-12-28The greatest happiness is to scatter inferiour APIs, to drive themKenneth R Westerback
before you, to see their files reduced to ashes, to see those who love them shrouded in tears, and to gather into your API all their invocations. In other words, workq is no more. There is only taskq. ok kettenis@ dlg@ (creator of taskq) jmc@
2014-12-28Replace last workq in tree (reading disklabels from newly attachedKenneth R Westerback
disks) with taskq. Diff originally from blambert@. ok kettenis@
2014-12-23unifdef INETTed Unangst
2014-12-22fix an error in piglet allocation when requesting an alignment < PAGE_SIZEMike Larkin
(which we never did, but it was a bug nonetheless). ok kettenis, deraadt
2014-12-22Make it possible to execute PIE binaries that don't have an PT_INTERP segmentMark Kettenis
(and therefore no interpreter). Necessary to make self-relocating "static" PIE working. This will also allow execution of shared libraries that have the 'x' bit set. Those shouldn't exist, but unfortunately people outside OpenBSD think differently which means third-party software sometimes installs shared libraries with the 'x' bit set. ok kurt@, deraadt@