summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2012-03-14Close a race that would corrupt a sockbuf because the code that externalizesMark Kettenis
an SCM_RIGHTS message may sleep. Bits and pieces from NetBSD with some simplifications by yours truly. Fixes the "receive 1" panic seen by many. ok guenther@, claudio@
2012-03-130 is a valid uid for files sysctl, don't skip it. ok guentherTed Unangst
2012-03-10Account for sched_noidle and document the scheduler variables.Christiano F. Haesbaert
ok tedu@
2012-03-10Give sigwait priority over ptrace to avoid panicPhilip Guenthe
2012-03-10Add PS_EXITING to better differentiate between the process exiting andPhilip Guenthe
the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
2012-03-09New vmmap implementation.Ariane van der Steldt
no oks (it is really a pain to review properly) extensively tested, I'm confident it'll be stable 'now is the time' from several icb inhabitants Diff provides: - ability to specify different allocators for different regions/maps - a simpler implementation of the current allocator - currently in compatibility mode: it will generate similar addresses as the old allocator
2012-02-25Allow this to build on platforms lacking PT_GETFPREGS or PT_SETFPREGS; brokenMiod Vallat
in previous rev.
2012-02-20First steps for making ptrace work with rthreads:Philip Guenthe
- move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and p_ptstat member from struct proc to struct process - sort the PT_* requests into those that take a PID vs those that can also take a TID - stub in PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT ok kettenis@
2012-02-15Enable rthreads by defaultPhilip Guenthe
ok deraadt@
2012-02-15Hold struct filedesc's fd_lock when writing to the fd_ofiles, fd_ofileflags,Philip Guenthe
or fd_{lo,hi}maps members, or when doing a read for a write. Fixes hangs when an rthreaded processes sleeps while copying the fd table for fork() and catches another thread with the lock. ok jsing@ tedu@
2012-02-10DUIDs are only valid when booting off of a disk, so make sure we arePeter Hessler
actually doing so before using them OK deraadt@, krw@
2012-02-05Fix SysV message queue identifiers.Bret Lambert
Found and diagnosed by Alexis Fouilhe hyjial at gmail dot com input miod@ guenther@ ok guenther@
2012-01-25A signal handled by __thrsigdivert() shouldn't be marked pendingPhilip Guenthe
for the thread handling it. Otherwise (i.e., no sig divert), prefer to deliver a process-aimed signal to some thread which doesn't have the signal blocked. ok tedu@
2012-01-21When disklabels can't be read before attempting to mount root, makeKenneth R Westerback
the message less scary and print out the failing devices to improve troubleshooting. ok jsing@
2012-01-21Make the KERN_FILE2 sysctl() report ENOMEM as documented in sysctl(3).Philip Guenthe
ok millert@
2012-01-21Do not wait for DKF_OPENED to be set if we never actually created aJoel Sing
callback for this disk. Fixes an issue found by krw on macppc. ok krw@
2012-01-17Reimplement mutexes, condvars, and rwlocks to eliminate bugs,Philip Guenthe
particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
2012-01-16Ensure that all disk attach callbacks have completed before attemptingJoel Sing
to locate the root via DUID. ok krw@
2012-01-13Always set DKF_OPENED in the disk attach callback.Joel Sing
2012-01-13Restore previous behaviour - only print the DUID if we used it toJoel Sing
select root.
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