summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Move struct proc's sigaltstack struct from the zeroed area into thejoshe2011-11-221-4/+13
| | | | | | | | | 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@
* Make userret() MI. On architectures which jammed stuff into it in thederaadt2011-11-161-1/+12
| | | | | past, pull that code out seperately. ok guenther miod
* Change fork1() and kthread_create() to match the rest of the treeguenther2011-11-091-7/+6
| | | | | | | | 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@
* MD trap() passes a MD "traptype" and siginfo-style "code" up to the MIderaadt2011-09-201-24/+23
| | | | | | | | | | 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
* Revert art@'s moving around of the KERNEL_LOCK()/KERNEL_UNLOCK() calls,guenther2011-07-111-5/+2
| | | | | | as it causes hangs in some ports, including libsigsegv's configure script confirmed by krw@, landry@
* More syscalls.master cleanup:matthew2011-07-091-45/+1
| | | | | | | | | | | | | | sys_osigaltstack() is 7 years old and no longer needed; all glory to the sys_sigaltstack()! sys_ogetdirentries() is about 9 months old, but still acceptable within our release cycle; move from STD to COMPAT_48 to make this clearer for tedu@ next year. sys_sbrk() and sys_sstk() are completely obsolete: all they do is return ENOSYS. ok guenther@
* There is a bunch of places in the kernel entry points where we don'tart2011-07-071-2/+5
| | | | | | | | | | | hold the kernel lock, but still need call one function that needs it. Instead of grabbing the lock all over the place, move the locks into the affected functions: trapsignal, scdebug*, ktrsyscall, ktrsysret, systrace_redirect and ADDUPROF. In the cases we already hold the biglock we'll just recurse. kettenis@, beck@ ok
* Clean up after P_BIGLOCK removal.art2011-07-061-3/+3
| | | | | | | KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK oga@ ok
* Recommit the reverted sigacts change now that the NFS use-after-freeguenther2011-07-051-86/+81
| | | | | | | | problem has been tracked down. This fixes the sharing of the signal handling state: shared bits go in sigacts, per-rthread bits goes in struct proc. ok deraadt@
* Revert the sigacts diff: NFS can apparently retain pointers to processesguenther2011-04-181-81/+86
| | | | | | 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
* Correct the sharing of the signal handling state: stuff that shouldguenther2011-04-151-86/+81
| | | | | | | | | | | | 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@
* Move PPWAIT flag from struct proc to process, so that rthreads inguenther2011-04-031-4/+5
| | | | | | | | | 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@
* Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, soguenther2011-04-021-4/+4
| | | | | | that you can't evade the checks by doing the dirty work in an rthread ok blambert@, deraadt@
* The scheduling 'nice' value is per-process, not per-thread, so move itguenther2011-03-071-3/+3
| | | | | | into struct process. ok tedu@ deraadt@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-29/+30
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* remove support for compat_sunos (and m68k4k). ok deraadt guenthertedu2010-07-021-12/+1
|
* Always identify threads with THREAD_PID_OFFSET, so that there's noguenther2010-07-011-11/+12
| | | | | | way a kill() intended for a thread can result in a separate process getting the signal. ok tedu@ art@
* lots of SCARG simplification. ok matthewtedu2010-06-301-20/+34
|
* Strip out ancient bits in struct user that were still used only byguenther2010-06-291-4/+1
| | | | | the now-removed HPUX compat code. ok and build testing deraadt@
* less SCARG, more pretty. ok guenthertedu2010-06-291-14/+15
|
* Eliminate RTHREADS kernel option in favor of a sysctl. The actual statustedu2010-06-291-21/+6
| | | | | (not done) hasn't changed, but now it's less work to test things. ok art deraadt
* <sys/time.b> is for ftime(), which is just in libcompat and not the kernel,guenther2010-06-281-2/+1
| | | | | so stop including it in kernel .c files. "sure" deraadt@
* move knote list to struct process. ok guenthertedu2010-05-181-4/+4
|
* Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tguenther2009-11-271-3/+29
| | | | | | | and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
* Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.kettenis2009-11-041-7/+2
| | | | ok jsing@, miod@
* We need miod's no-coredumps-on-ramdisks diff, because we have grown thederaadt2009-06-061-1/+11
| | | | media just a wee bit too much.
* %zu is not meant for size_t in the kernel. Change to %lu.ray2009-06-051-2/+2
| | | | OK miod
* Make ELF platforms generate ELF core dumps. Somewhat based on code fromkettenis2009-03-051-10/+57
| | | | | | NetBSD. ok kurt@, drahn@, miod@
* Remove KASSERT() that could trigger when an rthread in sigwait()guenther2009-01-291-4/+3
| | | | | | | | | got multiple signals before tsleep() could wakeup. Also, POSIX says that sigwait() should never return EINTR, so map that to ERESTART. ok kurt@, tedu@ fixes the panic encountered by ariane@ with kaffe
* Move the functionality of psignal() to a new function ptsignal()guenther2008-12-161-28/+64
| | | | | | | | | | | | | that takes an additional argument "type" that indicates whether the signal is for the process, just a particular thread, or propagated to a thread because it's not caught or blocked. psignal() becomes a wrapper that does the first of those. So that sys_kill() can tell apart signals for the process and signals for the process's original thread, the tid of the original thread is defined as its pid + THREAD_PID_OFFSET. ok tedu@ art@ andreas@ kurt@ "better early than late" deraadt@
* Make sigwait() work correctly. In particular, it'll work when theguenther2008-10-031-6/+47
| | | | | | | | | | | | | signal is already pending in the calling thread or the main thread and there's no longer a race condition where the signal could be diverted but sigwait() would still block. There were some off-by-one errors too. (The checking of the main thread's pending list is just until a pending list for the process can be added to struct process. For now, such signals end up as pending on the main thread.) oks tedu@ and art@
* posix compliant permission checks for sending signals. Based on diffshshoexer2008-06-101-11/+3
| | | | | | | provided by christian ehrhardt (Christian_Ehrhardt@genua.de) and micky, thanks! ok deraadt millert
* Use LIST_FOREACH() instead of handrolling.thib2008-05-221-2/+2
| | | | | From: Pierre Riteau pierre.riteau_att_gmail.com OK miod@
* typos; ok jmc@martynas2007-11-271-2/+2
| | | | sys/dev/pci/pciide.c from naddy@
* Don't overwrite a core file owned by a different user. Makes the codemillert2007-11-191-3/+3
| | | | match the comment. OK deraadt@
* replace the machine dependant bytes-to-clicks macro by the MI ptoa()martin2007-09-011-5/+5
| | | | | | | | version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
* Adjust filename buffer for the new /var/crash prefix to preventmoritz2007-05-301-4/+7
| | | | | | truncation and add an additional truncation check. ok deraadt@ tedu@
* update comment re nosuidcoredump sysctljcs2007-05-291-2/+3
| | | | ok tedu
* put suid coredumps into /var/crash if kern.nosuidcoredump is set to 2.tedu2007-05-291-7/+10
| | | | | makes debugging easier, docs in a bit ok beck deraadt
* Needs an extern decl for generic soft interrupts platforms.miod2007-05-081-1/+4
|
* First step in making the SCHED_LOCK not recursive.art2007-05-081-20/+60
| | | | | | | | | | | | | | | - Defer the sending of SIGCHLD and waking the parent when a process goes to sleep. We set a flag in the process "P_STOPPED" and schedule a timeout that checks all processes for this flag and sends SIGCHLD and wakes the parent on those processes that have this flag set. - Delay the waking of the parent in psignal on SIGCONT until we've released the SCHED_LOCK at the end. - In issignal, check for P_SINTR as a way to see we were called from the tsleep path with SCHED_LOCK locked and don't skip locking in that case. (This is slightly ugly, but it works until we have some better way). miod@ ok (after finding and fixing an MD bug on sgi)
* Start moving state that is shared among threads in a process intoart2007-04-031-8/+16
| | | | | | | | | | | a new struct. Instead of doing a huge rename and deal with the fallout for weeks, like other projects that need no mention, we will slowly and carefully move things out of struct proc into a new struct process. - Create struct process and the infrastructure to create and remove them. - Move threads in a process into struct process. deraadt@, tedu@ ok
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-10/+10
| | | | | | | | | | | | it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
* Use atomic.h operation for manipulating p_siglist in struct proc. Solvesart2007-02-061-14/+16
| | | | | | the problem with lost signals in MP kernels. miod@, kettenis@ ok
* When sending signals, instead of checking if the process sending theart2007-01-171-3/+4
| | | | | | | | | | | signal to is the curproc, check if it's SONPROC. That way we'll also signotify processes on other CPUs. This gives MD code the opportunity to actually deliver signals to other CPUs faster than the clock interrupt (in the worst case). This is a NOP until MD code is fixed. miod@ ok
* Retire VOP_LEASE(); It was a bit for NQNFS and hasthib2007-01-161-2/+1
| | | | | | | | | effectively been a no-op for quite some time now, without promise for future usage. ok pedro@ Testing by krw@ (earlier diff) and Johan Mson Lindman (tybollt@solace.miun.se)
* Nothing sets P_FSTRACE anymore, so remove all what's left of it.miod2006-06-151-16/+4
|
* killproc() is orphaned, so kill it; ok deraadt@miod2006-06-071-15/+1
|
* Remove traditional coredump support since all our platforms have propermiod2006-03-041-37/+11
| | | | cpu_coredump() behaviour.
* Compile out more rthreads stuff unless option RTHREADS;miod2006-02-201-2/+11
| | | | discussed with a few, ok tedu@