summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2011-11-23clamp uvm_page_rle() to 255 pages at a timeTheo de Raadt
ok mlarkin
2011-11-23block interrupts while pool_reclaim_all is grubbing around in every poolsDavid Gwynne
internals. this fixes a panic i got where a network interrupt tried to use the mbuf pools mutex while pool_reclaim_all already held it which lead to the same cpu trying to lock that mutex twice. ok deraadt@
2011-11-22Move struct proc's sigaltstack struct from the zeroed area into theJoshua Elsasser
copied area, and initialize it properly in the FORK_THREAD case. This restores the behavior of a forked process inheriting its parent's signal stack. ok guenther@
2011-11-22Ensure we are unpacking the right source address after skipping a range ofMike Larkin
RLE pages in hibernate. ok deraadt@
2011-11-21fix small (one stack word) kmem->user leak - the syscall code doesDamien Miller
not zero retval when returning an error, so don't copy it back to a ktracer in this case. dropped by R00T-DUDE in his "Unusual and Hilarious Vulnerabilities" talk at Ruxcon 2011; ok guenther@ miod@
2011-11-18no need to zero all the free pages since we will be skipping them withMike Larkin
rle. noticed by jasper
2011-11-18- fix a few trailing whitespaces and a spelloJasper Lievisse Adriaanse
- panic strings already get printed with a '\n', so remove the extra ones ok mlarkin@
2011-11-18fix a corner case in rle processing where the rle byte was the last byteMike Larkin
being written to an output buffer
2011-11-17physmem run length encoding (rle) for hibernate - don't compress or writeMike Larkin
pages that are free
2011-11-16Reduce use of globals in hibernate code.Mike Larkin
discussed with deraadt@
2011-11-16Make userret() MI. On architectures which jammed stuff into it in theTheo de Raadt
past, pull that code out seperately. ok guenther miod
2011-11-15on failure, hibernate io functions return an errno. not 1.Theo de Raadt
2011-11-14Use a fixed io_page for all hibernate I/O, which is needed forMike Larkin
ahci_hibernate_io, a skeleton of which is also provided in this diff. This code is from deraadt@. Tested on a few wd machines to ensure it works there as well.
2011-11-13Add some #defines for the various hibernate I/O modes, some of theMike Larkin
groundwork for *_hibernate_io functions other than wd_hibernate_io These changes were sent to me by deraadt@
2011-11-13In hibernate resume, free the piglet and other VAs we allocated duringMike Larkin
suspend. ok pirofti@
2011-11-13Fix a handful of bugs that were causing reboots and other bad behaviorMike Larkin
during hibernate resumes.
2011-11-09Change fork1() and kthread_create() to match the rest of the treePhilip Guenthe
and use curp vs p instead of p1 vs p2. Add curpr and pr variables for the respective struct processes. Make sigactsshare() return the shared sigacts intead of taking the struct proc to update. ok deraadt@
2011-11-07Make pwrite/pwritev ignore the O_APPEND flag.Philip Guenthe
Detect attempts to wrap the file offset by reading past the max (except for character devices). ok matthew@, deraadt@
2011-11-06Negative offsets to pread/pwrite-family are only legal for character devices.Philip Guenthe
Pointed out by Alexander Polakov (polachok at gmail.com) ok deraadt@
2011-11-06Document a non-obvious reason why something can't overflow.Philip Guenthe
Discussed with deraadt@
2011-11-05I had moved earlier the adding of processes to the pgrp and children listsPhilip Guenthe
during the big rework at c2k10, but it's too early as signals can be posted before the process is fully built. Move those list adds back down to the late stage they were before. Problem seen on sebastia@'s sparc. ok deraadt@ miod@
2011-11-05ttys can't seek, so make pread/pwrite/preadv/pwritev fail with ESPIPEPhilip Guenthe
on them too ok deraadt@, miod@
2011-10-27Allow segments to be used even after they were marked for deletion withRobert Nagy
the IPC_RMID flag. This is permitted as an extension beyond the standards and this is similar to what other operating systems like linux do. Because compat_linux(8) was emulating this already, remove that code since now this is the default. input from oga@, guenther@, jmc@, deraadt@ ok deraadt@
2011-10-23shorten periods of fdplock() in accept() and socket(), so that greaterTheo de Raadt
concurrency is possible in the future. discussed with guenther and matthew. ok tedu
2011-10-16TCB address should be reset when execing, to provide a clean setup forPhilip Guenthe
the new image
2011-10-15syncPhilip Guenthe
2011-10-15"TLS-lite": add kernel support for a per-thread userspace pointer,Philip Guenthe
for pointing to the thread-control-block. Support for mapping this to the correct hardware register can be added as it's finished; start with support for amd64, sparc, and sparc64. Includes syscalls for getting and setting it (for a portable __errno implementation) as well as creating a new thread with an initial value for it. discussed with miod@, kettenis@, deraadt@; committing to get the syscalls in with the impending libc bump and do further refinements in tree
2011-10-12Remove all MD diagnostics in cpu_switchto(), and move them to MI code ifMiod Vallat
they apply. ok oga@ deraadt@
2011-10-06Introduce a kqfilter wrapper for the controlling tty device entryMike Belopuhov
which allows a correct registration of kqueue(2) notifications on the /dev/tty instead of calling a function via a null pointer in the ttkqfilter leading to a local DoS. Surprisingly the same code is present in NetBSD since the kqueue merge, but didn't make it to the OpenBSD for 10 years. Thanks to Anton Yabchinskiy <arn-at-bestmx-dot-ru> for a GHCi crash report and his willingness to test multiple diffs for over a week. With input from nicm, ok miod, derraadt.
2011-09-23touching pr_nput and pr_nget outside the lock might be racy since ++ and --David Gwynne
arent necessarily atomic. this is an update of a diff matthew@ posted to tech@ over a year ago.
2011-09-23ph = pool_get(&phpool, PR_NOWAIT) can return NULL, so dont unconditionallyDavid Gwynne
write to ph. ok blambert@ matthew@ deraadt@
2011-09-22KNF of mlarkin's code, requested by him. Some improvements to the interfaceTheo de Raadt
for talking to the disk driver snuck in. ok mlarkin
2011-09-22Improve kernel malloc type checking.Joel Sing
ok deraadt@
2011-09-21Move the prototype for disk_readlabel to the .h file so that hibernateTheo de Raadt
can get at it. ok jsing
2011-09-21Cleanup page calculation for final memory chunk ordering list forMike Larkin
hibernate resume.
2011-09-21Perform most of the remaining refactoring of hibernate code intoMike Larkin
MI/MD parts. This also introduces a chunk placement routine that was originally developed at c2k11 with help from drahn and ariane. There are still a few more things to do for hibernate, but those can be worked on in-tree. This code is disabled by default, and not yet called. ok deraadt@ (and deraadt@ said kettenis@ also ok'ed it :) )
2011-09-20MD trap() passes a MD "traptype" and siginfo-style "code" up to the MITheo de Raadt
layers. Then things get terribly confusing because the various MI layers swap variable names for parameters, local variables, and structure fields numerous times. Unconfuse all this mess. Note that exec_elf.c coredump cpi_sigcode used to contain the MD traptype but will now contain the MI siginfo-style "code" value. ok miod kettenis pirofti
2011-09-19clean up buffer cache statistics somewhat toBob Beck
remove some now useless statistics, and add some relevant ones regarding kva usage in the cache. make systat io and show bcstats in ddb both show these counters. ok deraadt@ krw@
2011-09-18%, is not a valid format specifierMiod Vallat
2011-09-18One more %hh format string.Miod Vallat
2011-09-18Do not use the `hh' modifier in printf format strings, as the kernel printfMiod Vallat
implementation does not support it and handles it as `h'. ok jsing@
2011-09-18Make sysctl__string() handle the truncated output case via twoPhilip Guenthe
copyout()s instead of altering the in-use variable, and to also return the full length via oldlenp in that case as documented. ok jsing@ (problem pointed out by matthew@)
2011-08-28lockmgr() wants to use a different address for the wchan when drainingPhilip Guenthe
the lock, but a change in member ordering meant it was using the same address. Explicitly use different members instead of mixing address of member and address of the lock itself. ok miod@
2011-08-23iPrevent that a socket splicing timeout error in one direction isAlexander Bluhm
also added to the other direction. ok mikeb@
2011-07-30When using rthreads, the thread that calls exit will be the last one toJoel Sing
actually exit. This means that the main thread will exit and free the process group, which results in the thread dereferencing a null pointer when it is woken back up. Avoid this by checking that the ps_pgrp is not null before deferefencing it. Also expand the ps_session macro to avoid hiding the dereference. ok tedu@
2011-07-28Kill integer from pointer warning when compiling with MALLOC_DEBUG.Ryan Thomas McBride
ok kettenis
2011-07-26No need to byte-swap d_checksum just before setting it to zero.Kenneth R Westerback
ok matthew@
2011-07-25two more syscall functions that should have returned int, not pid_tTed Unangst
2011-07-25Make sure vfsp is not used uninitialized in the mount -o update case;Miod Vallat
ok krw@ matthew@
2011-07-25sys_wait4 properly returns int. ok deraadtTed Unangst