summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sig.c
AgeCommit message (Collapse)Author
2010-07-26Correct the links between threads, processes, pgrps, and sessions,Philip Guenthe
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
2010-07-02remove support for compat_sunos (and m68k4k). ok deraadt guentherTed Unangst
2010-07-01Always identify threads with THREAD_PID_OFFSET, so that there's noPhilip Guenthe
way a kill() intended for a thread can result in a separate process getting the signal. ok tedu@ art@
2010-06-30lots of SCARG simplification. ok matthewTed Unangst
2010-06-29Strip out ancient bits in struct user that were still used only byPhilip Guenthe
the now-removed HPUX compat code. ok and build testing deraadt@
2010-06-29less SCARG, more pretty. ok guentherTed Unangst
2010-06-29Eliminate RTHREADS kernel option in favor of a sysctl. The actual statusTed Unangst
(not done) hasn't changed, but now it's less work to test things. ok art deraadt
2010-06-28<sys/time.b> is for ftime(), which is just in libcompat and not the kernel,Philip Guenthe
so stop including it in kernel .c files. "sure" deraadt@
2010-05-18move knote list to struct process. ok guentherTed Unangst
2009-11-27Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tPhilip Guenthe
and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
2009-11-04Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.Mark Kettenis
ok jsing@, miod@
2009-06-06We need miod's no-coredumps-on-ramdisks diff, because we have grown theTheo de Raadt
media just a wee bit too much.
2009-06-05%zu is not meant for size_t in the kernel. Change to %lu.Ray Lai
OK miod
2009-03-05Make ELF platforms generate ELF core dumps. Somewhat based on code fromMark Kettenis
NetBSD. ok kurt@, drahn@, miod@
2009-01-29Remove KASSERT() that could trigger when an rthread in sigwait()Philip Guenthe
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
2008-12-16Move the functionality of psignal() to a new function ptsignal()Philip Guenthe
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@
2008-10-03Make sigwait() work correctly. In particular, it'll work when thePhilip Guenthe
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@
2008-06-10posix compliant permission checks for sending signals. Based on diffsHans-Joerg Hoexer
provided by christian ehrhardt (Christian_Ehrhardt@genua.de) and micky, thanks! ok deraadt millert
2008-05-22Use LIST_FOREACH() instead of handrolling.Thordur I. Bjornsson
From: Pierre Riteau pierre.riteau_att_gmail.com OK miod@
2007-11-27typos; ok jmc@Martynas Venckus
sys/dev/pci/pciide.c from naddy@
2007-11-19Don't overwrite a core file owned by a different user. Makes the codeTodd C. Miller
match the comment. OK deraadt@
2007-09-01replace the machine dependant bytes-to-clicks macro by the MI ptoa()Martin Reindl
version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
2007-05-30Adjust filename buffer for the new /var/crash prefix to preventMoritz Jodeit
truncation and add an additional truncation check. ok deraadt@ tedu@
2007-05-29update comment re nosuidcoredump sysctljoshua stein
ok tedu
2007-05-29put suid coredumps into /var/crash if kern.nosuidcoredump is set to 2.Ted Unangst
makes debugging easier, docs in a bit ok beck deraadt
2007-05-08Needs an extern decl for generic soft interrupts platforms.Miod Vallat
2007-05-08First step in making the SCHED_LOCK not recursive.Artur Grabowski
- 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)
2007-04-03Start moving state that is shared among threads in a process intoArtur Grabowski
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
2007-03-15Since p_flag is often manipulated in interrupts and without biglockArtur Grabowski
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
2007-02-06Use atomic.h operation for manipulating p_siglist in struct proc. SolvesArtur Grabowski
the problem with lost signals in MP kernels. miod@, kettenis@ ok
2007-01-17When sending signals, instead of checking if the process sending theArtur Grabowski
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
2007-01-16Retire VOP_LEASE(); It was a bit for NQNFS and hasThordur I. Bjornsson
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)
2006-06-15Nothing sets P_FSTRACE anymore, so remove all what's left of it.Miod Vallat
2006-06-07killproc() is orphaned, so kill it; ok deraadt@Miod Vallat
2006-03-04Remove traditional coredump support since all our platforms have properMiod Vallat
cpu_coredump() behaviour.
2006-02-20Compile out more rthreads stuff unless option RTHREADS;Miod Vallat
discussed with a few, ok tedu@
2006-01-18Fix logic botch when checking for COMPAT_SUNOS binary specifics; repairsMiod Vallat
some TIOCGPGRP result fallout. ok deraadt@
2005-12-221. when signalling a process group, don't deliver a copy to every threadTed Unangst
2. when delivering a STOP or CONT signal to a process, now replicate to every thread. makes ^Z and fg work nicer, first noticed by peter hessler. signals and threads are not right, but this is at least a little less wrong.
2005-12-03kernel support for threaded processes (rthreads).Ted Unangst
uses rfork(RFTHREAD) to create threads, which are presently processes that are a little more tightly bound together. several new syscalls added to facilitate a userland thread library. all conditional on RTHREADS, currently disabled. ok deraadt
2005-11-28ansi/deregister.Jonathan Gray
'go for it' deraadt@
2005-06-17A second approach at fixing the telnet localhost & problemNiklas Hallqvist
(but I tend to call it ssh localhost & now when telnetd is history). This is more localized patch, but leaves us with a recursive lock for protecting scheduling and signal state. Better care is taken to actually be symmetric over mi_switch. Also, the dolock cruft in psignal can go with this solution. Better test runs by more people for longer time has been carried out compared to the c2k5 patch. Long term the current mess with interruptible sleep, the default action on stop signals and wakeup interactions need to be revisited. ok deraadt@, art@
2005-05-29sched work by niklas and art backed out; causes panicsTheo de Raadt
2005-05-25This patch is mortly art's work and was done *a year* ago. Art wants to thankNiklas Hallqvist
everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-07-04proc_stop needs sched_lock locked. From art, verified with NetBSD.Niklas Hallqvist
2004-06-13debranch SMP, have funNiklas Hallqvist
2004-04-06fix siginfo generation for posted signals and avoid double ktrpsig() call ↵Michael Shalayeff
for the same signal; deraadt@ ok
2004-01-14change sigaltstack.ss_size type to size_t. handle syscall fallout.Ted Unangst
add stack_t and ucontext_t typedefs. ok deraadt@
2003-09-01match syscallargs comments with realityHenning Brauer
from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
2003-08-15change arguments to suser. suser now takes the process, and a flagsTed Unangst
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@