summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
Commit message (Collapse)AuthorAgeFilesLines
* Add sysctl descriptions to many SYSCTL_XXXsbillf1999-05-031-3/+6
| | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style)
* This Implements the mumbled about "Jail" feature.phk1999-04-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Enable Linux threads support by default.julian1999-01-261-76/+1
| | | | | | | | | This takes the conditionals out of the code that has been tested by various people for a while. ps and friends (libkvm) will need a recompile as some proc structure changes are made. Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* KNFize, by bde.eivind1999-01-101-2/+2
|
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT aseivind1999-01-081-9/+5
| | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
* Reviewed by: Luoqi Chen, Jordan Hubbardjulian1998-12-191-1/+75
| | | | | | | | | | | | Submitted by: "Richard Seaman, Jr." <lists@tar.com> Obtained from: linux :-) Code to allow Linux Threads to run under FreeBSD. By default not enabled This code is dependent on the conditional COMPAT_LINUX_THREADS (suggested by Garret) This is not yet a 'real' option but will be within some number of hours.
* Check return value of malloc() in expand_name.eivind1998-12-021-1/+3
| | | | Reviewed by: sef
* Installed the second patch attached to kern/7899 with some changes suggestedtruckman1998-11-111-1/+38
| | | | | | | | | | | | | | | | by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
* Eliminate a superfluous comment.jdp1998-10-211-5/+1
|
* Remove includes that are no longer needed, now that the core dumpingjdp1998-09-141-9/+1
| | | | code has been moved into the respective imgact_xxx.c sources.
* Add provisions for variant core dump file formats, depending on thejdp1998-09-141-73/+9
| | | | | | | | | | | object format of the executable being dumped. This is the first step toward producing ELF core dumps in the proper format. I will commit the code to generate the ELF core dumps Real Soon Now. In the meantime, ELF executables won't dump core at all. That is probably no less useful than dumping a.out-style core dumps as they have done until now. Submitted by: Alex <garbanzo@hooked.net> (with very minor changes by me)
* Make the logging of abnormally exiting processes optional by a sysctl.joerg1998-07-281-6/+11
| | | | | PR: kern/1711 Submitted by: Nick Sayer <nsayer@kfu.com>
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-2/+2
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* Add support for run-time configuration of core file names. In a nutshell,sef1998-07-081-5/+93
| | | | | | | | | | | you can specify the corefile name by using: sysctl -w kern.corefile="format" where format is a pathname (relative or absolute -- default is "%N.core"), with "%N" (process name), "%P" (process ID), and "%U" (user ID) formats. Reviewed by: Mike Smith, with strong requests by Julian :)
* Added a sysctl variable kern.sugid_coredump for controlling coredumpdg1998-06-281-2/+7
| | | | behavior of setuid/setgid binaries that defaults to 0 (coredump disabled).
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Forward the signal if the process runs on a different CPU. This reducestegge1998-03-031-1/+8
| | | | | | | | the signal handling latency for cpu-bound processes that performs very few system calls. The IPI for forcing an additional software trap is no longer dependent upon BETTER_CLOCK being defined.
* Back out DIAGNOSTIC changes.eivind1998-02-061-2/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+2
|
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+2
|
* Changes to allow event-based process monitoring and control.sef1997-12-061-6/+21
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-29/+17
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Implement SA_NOCLDWAIT.joerg1997-09-131-1/+16
| | | | | | | | | | | | | | | | | | | | The implementation is done (unlike what i've originally been contemplating) by reparenting kids of processes that have the appropriate bit set to PID 1, and let PID 1 handle the zombie. This is far less problematical than what would seem to be ``doing it right'', for a number of reasons. Of our currently shipping PID-1-intended programs, 50 % fail the above assumption. ;-) (Read this: sysinstall doesn't do it right. This is no problem as long as no program called by sysinstall actually uses SA_NOCLDWAIT.) ToDo: . clarify the correct SA_* flag inheritance, compared to other systems, . decide whether the compat cruft (osigvec(9)) should deal with new system additions or not, . merge OpenBSD's SA_SIGINFO implementation. ;) Reviewed by: bde
* Removed unused #includes.bde1997-09-021-6/+1
|
* Finished staticizing.bde1997-08-261-3/+5
|
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-4/+4
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fixed sigaction() for SIGKILL and SIGSTOP. Reading the old action nowbde1996-11-291-5/+9
| | | | | | | | | succeeds. Writing an action now succeeds iff the handler isn't changed. (POSIX allows attempts to change the handler to be ignored or cause an error. Changing other parts of the action is allowed (except attempts to mask unmaskable signals are silently ignored as usual).) Found by: NIST-PCTS
* Kill unnecessary test in coredump() that wasn't removed in rev 1.19dg1996-10-191-9/+2
| | | | when the check for P_SUGID was added.
* Log not exited signal only, but the fact that core dumped (or not) tooache1996-07-091-5/+6
|
* Removed unnecessary #includes from <sys/imgact.h> so that it isbde1996-05-011-2/+1
| | | | self-sufficient and added explicit #includes where required.
* Correct the handling of NOCLDSTOP when using sigvec()peter1996-03-301-12/+24
| | | | | | | | | Make the SA_NODEFER handling more correct, previously if you called sigaction to set a handler and had SA_NODEFER set, and manually masked the signal itself in sa_mask, and when you read the settings back later, you'd find SA_NODEFER incorrectly cleared. Pointed out by: bde
* Actually implement SA_RESETHAND - some of the sigaction code recognised itpeter1996-03-151-11/+27
| | | | | | | | | | but didn't actually do anything with it (*blush*). This should fix bde's test case where the test program set SA_RESETHAND and when reading it back, it was gone. Tweak/optimize SA_NODEFER so that the implementation is a little simpler and does not incur (slight) overhead for every signal at delivery time.
* From Lite2: proc LIST changes.hsu1996-03-111-4/+6
| | | | Reviewed by: david & bde
* From Lite2: change code parameter to u_long and initialize ps_sig.hsu1996-03-111-2/+4
| | | | Reviewed by: davidg & bde
* Mega-commit for Linux emulator update.. This has been stress tested underpeter1996-03-021-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netscape-2.0 for Linux running all the Java stuff. The scrollbars are now working, at least on my machine. (whew! :-) I'm uncomfortable with the size of this commit, but it's too inter-dependant to easily seperate out. The main changes: COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386 machine dependent section into the linux emulator itself. The int 0x80 syscall code was almost identical to the lcall 7,0 code and a minor tweak allows them to both be used with the same C code. All kernels can now just modload the lkm and it'll DTRT without having to rebuild the kernel first. Like IBCS2, you can statically compile it in with "options LINUX". A pile of new syscalls implemented, including getdents(), llseek(), readv(), writev(), msync(), personality(). The Linux-ELF libraries want to use some of these. linux_select() now obeys Linux semantics, ie: returns the time remaining of the timeout value rather than leaving it the original value. Quite a few bugs removed, including incorrect arguments being used in syscalls.. eg: mixups between passing the sigset as an int, vs passing it as a pointer and doing a copyin(), missing return values, unhandled cases, SIOC* ioctls, etc. The build for the code has changed. i386/conf/files now knows how to build linux_genassym and generate linux_assym.h on the fly. Supporting changes elsewhere in the kernel: The user-mode signal trampoline has moved from the U area to immediately below the top of the stack (below PS_STRINGS). This allows the different binary emulations to have their own signal trampoline code (which gets rid of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so that the emulator can provide the exact "struct sigcontext *" argument to the program's signal handlers. The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which have the same values as the re-used SA_DISABLE and SA_ONSTACK which are intended for sigaction only. This enables the support of a SA_RESETHAND flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal semantics where the signal handler is reset when it's triggered. makesyscalls.sh no longer appends the struct sysentvec on the end of the generated init_sysent.c code. It's a lot saner to have it in a seperate file rather than trying to update the structure inside the awk script. :-) At exec time, the dozen bytes or so of signal trampoline code are copied to the top of the user's stack, rather than obtaining the trampoline code the old way by getting a clone of the parent's user area. This allows Linux and native binaries to freely exec each other without getting trampolines mixed up.
* Improved killproc() log message and made it and the other similar messagedg1996-01-311-8/+7
| | | | | tolerant of p_ucred being invalid. Starting using killproc() where appropriate.
* Converted two options over to the new scheme: USER_LDT and KTRACE.wollman1996-01-031-1/+3
|
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-5/+7
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+6
|
* Cleaned up SA_NODEFER changes.bde1995-11-181-6/+6
| | | | Added prototypes.
* Included <sys/sysproto.h> to get central declarations for syscall argsbde1995-11-121-1/+26
| | | | | | | | | | structs and prototypes for syscalls. Ifdefed duplicated decentralized declarations of args structs. It's convenient to have this visible but they are hard to maintain. Some are already different from the central declarations. 4.4lite2 puts them in comments in the function headers but I wanted to avoid the large changes for that.
* Implement SA_NODEFER sa_flag for sigaction():swallace1995-10-191-3/+12
| | | | | | | | | | | Add SA_NODEFER define to signal.h Add ps_nodefer field to struct sigacts in signalvar.h. Add code to kern_sig.c to handle SA_NODEFER. If flag is set, when the signal is delivered, it is not masked automatically from receiving the same signal again. Reviewed by: wollman, bde
* Remove trailing whitespace.rgrimes1995-05-301-11/+11
|
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-2/+1
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* Correct a name of one structure member in the sigaltstack structure.ats1995-01-291-4/+4
| | | | | | Now it matches the man page and also the only other commercial implementation i have found so far ( Solaris 2.x). Changed the name from ss_base to ss_sp.
* Security nitpicking: don't make *.core world readableache1994-11-061-2/+2
|
* Cosmetics. related to getting prototypes into view.phk1994-10-101-53/+53
|
OpenPOWER on IntegriCloud