summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2012-01-11If the DUID of the boot disk has not been provided, attempt to locate itJoel Sing
via the boot device. This allows root on softraid to work on most architectures. For architectures that cannot clearly identify their boot device, the DUID of the boot disk can still be passed from the boot loader, as is already done for amd64 and i386. Based on a suggestion from kettenis@ ok krw@
2012-01-11Move softraid root mapping to later in the boot process - this will allowJoel Sing
us to play some tricks in setroot().
2012-01-10Replace the only occurrence of the obscure macro SLIST_FOREACH_PREVPTR.Alexander Bluhm
No binary change. ok mikeb@ deraadt@ guenther@
2012-01-07Add rtable id and thread id to struct kinfo_proc (and fix process id)Philip Guenthe
and add an 'rtableid' keyword to ps. Add rtable id, thread id, and socket splice info to struct kinfo_file2 and make fstat display socket splice information. Remove old KVM_PROC2 and kinfo_proc2 interfaces; bump libkvm major Socket splice info and corrections from bluhm@ "Lovely" deraadt@
2012-01-04Fix use after free in cache_lookup() - found by PedroBob Beck
fix is to manipulate the name cache structures before potentially sleeping on a vn_lock(). This avoids the race of the ncp entry being recycled while we are asleep. run in snaps and on ftp.openbsd.org for months ok thib@
2012-01-01copyright++Federico G. Schwindt
2011-12-28Avoid the use of an invalid disklabel by setting a DK_LABELVALID flagJoel Sing
if we correctly read and validated the disklabel. Always check that this flag is set before using the DUID from the disklabel. Discussed with deraadt@ ok krw@
2011-12-28An all-zero DUID is considered to be a blank DUID - ensure that we do notJoel Sing
generate one. ok krw@
2011-12-14Handle rthreads consistently in ktrace by moving the flags and vnode intoPhilip Guenthe
struct process; KTRFAC_ACTIVE becomes P_INKTR. Also, save the credentials used to open the file in sys_ktrace() and use them for all writes to the vnode. much feedback and ok jsing@
2011-12-11Suspend other rthreads before dumping core or execing; make them exitPhilip Guenthe
when exec succeeds. ok jsing@
2011-12-09Add new KERN_PROC_CWD sysctl to get the current working directory of a process.Nicholas Marriott
ok guenther deraadt
2011-12-03add support for MSG_NOSIGNAL.Federico G. Schwindt
linux bits compiled on i386 by sebastia@, mikeb@ ok
2011-12-02dont put MAXMCLBYTES in the mclsizes array with a comment saying its 64kDavid Gwynne
when the macro can change without automatically fixing the comment. instead add a diagnostic that checks that the biggest cluster size is always MAXMCLBYTES. requested by and ok kettenis@
2011-11-30this diff introduces the MAXMCLBYTES macro to describe the largestDavid Gwynne
cluster the generic network stack will be able to give you. it also recognises that external storage on an mbuf may be bigger than MCLBYTES. its only when m_pullup or m_pulldown need to allocate another cluster that they now check the len argument, and now they do it against MAXMCLBYTES. this is required for me to do pfsync on jumbo frames as the m_pulldown for the subregions fail beyond MCLBYTES into the packet. ok deraadt@ mikeb@ henning@ blambert@ manpage changes ok jmc@
2011-11-30correctly calculate the space available in external storage in m_pullup.David Gwynne
ok deraadt@ claudio@ blambert@ mikeb@
2011-11-29whitespace fixes. no binary change.David Gwynne
2011-11-29ready this for big-endian support later onTheo de Raadt
ok mlarkin
2011-11-29Only free the piglet on hibernate fail if we are suspending.Mike Larkin
2011-11-27When checking for offset wrap around in vn_read(), compare againstPhilip Guenthe
LLONG_MAX instead of SSIZE_MAX ok deraadt@
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@