summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4/svr4_signal.c
Commit message (Collapse)AuthorAgeFilesLines
* Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57,rwatson2005-09-281-4/+1
| | | | | | | | | | | | | | | | | | | | osf1_signal.c:1.41, amd64/amd64/trap.c:1.291, linux_socket.c:1.60, svr4_fcntl.c:1.36, svr4_ioctl.c:1.23, svr4_ipc.c:1.18, svr4_misc.c:1.81, svr4_signal.c:1.34, svr4_stat.c:1.21, svr4_stream.c:1.55, svr4_termios.c:1.13, svr4_ttold.c:1.15, svr4_util.h:1.10, ext2_alloc.c:1.43, i386/i386/trap.c:1.279, vm86.c:1.58, unaligned.c:1.12, imgact_elf.c:1.164, ffs_alloc.c:1.133: Now that Giant is acquired in uprintf() and tprintf(), the caller no longer leads to acquire Giant unless it also holds another mutex that would generate a lock order reversal when calling into these functions. Specifically not backed out is the acquisition of Giant in nfs_socket.c and rpcclnt.c, where local mutexes are held and would otherwise violate the lock order with Giant. This aligns this code more with the eventual locking of ttys. Suggested by: bde
* Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),rwatson2005-09-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment). Modify all consumers of uprintf() and tprintf() to hold Giant around calls into these functions. In most cases, this means adding an acquisition of Giant immediately around the function. In some cases (nfs_timer()), it means acquiring Giant higher up in the callout. With these changes, UFS no longer panics on SMP when either blocks are exhausted or inodes are exhausted under load due to races in the tty code when running without Giant. NB: Some reduction in calls to uprintf() in the svr4 code is probably desirable. NB: In the case of nfs_timer(), calling uprintf() while holding a mutex, or even in a callout at all, is a bad idea, and will generate warnings and potential upset. This needs to be fixed, but was a problem before this change. NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having non-MPSAFE tty code. MFC after: 1 week
* fixup signal mapping:sam2005-02-251-11/+9
| | | | | | | | | | | | | | o change the mapping arrays to have a zero offset rather than base 1; this eliminates lots of signo adjustments and brings the code back inline with the original netbsd code o purge use of SVR4_SIGTBLZ; SVR4_NSIG is the only definition for how big a mapping array is o change the mapping loops to explicitly ignore signal 0 o purge some bogus code from bsd_to_svr4_sigset o adjust svr4_sysentvec to deal with the mapping table change Enticed into fixing by: Coverity Prevent analysis tool Glanced at by: marcel, jhb
* Backout previous change (disabling of security checks for signals deliveredsobomax2005-02-131-1/+1
| | | | | | in emulation layers), since it appears to be too broad. Requested by: rwatson
* Split out kill(2) syscall service routine into user-level and kernel part, thesobomax2005-02-131-1/+1
| | | | | | | | | | | | | | | | | former is callable from user space and the latter from the kernel one. Make kernel version take additional argument which tells if the respective call should check for additional restrictions for sending signals to suid/sugid applications or not. Make all emulation layers using non-checked version, since signal numbers in emulation layers can have different meaning that in native mode and such protection can cause misbehaviour. As a result remove LIBTHR from the signals allowed to be delivered to a suid/sugid application. Requested (sorta) by: rwatson MFC after: 2 weeks
* Start each of the license/copyright comments with /*-imp2005-01-051-1/+1
|
* Fix some security bugs in the SVR4 emulator:tjr2003-10-201-2/+12
| | | | | | | | | | | | | | | | | | | - Return NULL instead of returning memory outside of the stackgap in stackgap_alloc() (FreeBSD-SA-00:42.linux) - Check for stackgap_alloc() returning NULL in svr4_emul_find(), and clean_pipe(). - Avoid integer overflow on large nfds argument in svr4_sys_poll() - Reject negative nbytes argument in svr4_sys_getdents() - Don't copy out past the end of the struct componentname pathname buffer in svr4_sys_resolvepath() - Reject out-of-range signal numbers in svr4_sys_sigaction(), svr4_sys_signal(), and svr4_sys_kill(). - Don't malloc() user-specified lengths in show_ioc() and show_strbuf(), place arbitrary limits instead. - Range-check lengths in si_listen(), ti_getinfo(), ti_bind(), svr4_do_putmsg(), svr4_do_getmsg(), svr4_stream_ti_ioctl(). Some fixes obtain from OpenBSD.
* Use __FBSDID().obrien2003-06-101-2/+3
|
* - Replace inline implementations of sigprocmask() with calls tojhb2003-04-221-206/+97
| | | | | | | kern_sigprocmask() in the various binary compatibility emulators. - Replace calls to sigsuspend(), sigaltstack(), sigaction(), and sigprocmask() that used the stackgap with calls to the corresponding kern_sig*() functions instead without using the stackgap.
* Use local struct proc variables to reduce repeated td->td_proc dereferencesjhb2003-04-171-6/+6
| | | | and improve readability.
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-12/+13
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* SCARGS removal take II.alfred2002-12-141-41/+41
|
* Backout removal SCARGS, the code freeze is only "selectively" over.alfred2002-12-131-41/+41
|
* Remove SCARGS.alfred2002-12-131-41/+41
| | | | Reviewed by: md5
* Back our kernel support for reliable signal queues.jmallett2002-10-011-1/+1
| | | | Requested by: rwatson, phk, and many others
* First half of implementation of ksiginfo, signal queues, and such. Thisjmallett2002-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | gets signals operating based on a TailQ, and is good enough to run X11, GNOME, and do job control. There are some intricate parts which could be more refined to match the sigset_t versions, but those require further evaluation of directions in which our signal system can expand and contract to fit our needs. After this has been in the tree for a while, I will make in kernel API changes, most notably to trapsignal(9) and sendsig(9), to use ksiginfo more robustly, such that we can actually pass information with our (queued) signals to the userland. That will also result in using a struct ksiginfo pointer, rather than a signal number, in a lot of kern_sig.c, to refer to an individual pending signal queue member, but right now there is no defined behaviour for such. CODAFS is unfinished in this regard because the logic is unclear in some places. Sponsored by: New Gold Technology Reviewed by: bde, tjr, jake [an older version, logic similar]
* Moved signal handling and rescheduling from userret() to ast() so thatbde2002-04-041-0/+2
| | | | | | | | | | | they aren't in the usual path of execution for syscalls and traps. The main complication for this is that we have to set flags to control ast() everywhere that changes the signal mask. Avoid locking in userret() in most of the remaining cases. Submitted by: luoqi (first part only, long ago, reorganized by me) Reminded by: dillon
* Remove __P.alfred2002-03-201-5/+3
|
* KSE Milestone 2julian2001-09-121-58/+58
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* get rid of some printf and pointer type warningsassar2001-07-221-1/+1
|
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-1/+3
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Proc locking.jhb2001-01-231-4/+10
|
* Include machine/cpu.h for cpu_getstack().marcel2000-12-031-0/+2
| | | | Spotted by: jake
* Don't use p->p_sigstk.ss_flags to keep state of whether themarcel2000-11-301-1/+1
| | | | | | | | | | | | | | | process is on the alternate stack or not. For compatibility with sigstack(2) state is being updated if such is needed. We now determine whether the process is on the alternate stack by looking at its stack pointer. This allows a process to siglongjmp from a signal handler on the alternate stack to the place of the sigsetjmp on the normal stack. When maintaining state, this would have invalidated the state information and causing a subsequent signal to be delivered on the normal stack instead of the alternate stack. PR: 22286
* Cleanup after repo copy of sys/svr4 to sys/compat/svr4.obrien2000-08-311-6/+6
|
* Fix handling of svr4_sigsets, which are implemented in SysVR4 as a sequencenewton2000-01-151-14/+50
| | | | | | | | | | | | | | | | | | | | of 4 longs used as a bitmask. sv4r4_sigfillset has been broken for a while, probably since rev 1.5. This patch fixes SVR4_NSIG (i.e.: sets it to the actual number of signals, instead of the number of bits in the mask) because some SysVR4 clients honestly seem to care about whether bits in the signal mask are set for non-existant signals. Additionally, the svr4_sigfillset macro has been replaced by a fully fledged function, because the macro didn't actually work (it returned an all-ones mask, but we don't want that: we want 0's set where FreeBSD doesn't actually have a signal which is the same as an SysVR4 signal, for example). SysVR4 clients can now successfully ignore signals, although catching them remains problematic (see commit log message for rev1.13 of sys/i386/svr4/svr4_machdep.c for more info).
* Remove unnecessary includesnewton1999-12-081-1/+0
| | | | Prodded by: phk
* Remove unnecessary includes.newton1999-10-171-3/+0
| | | | Submitted by: phk
* Add a per-signal flag to mark handlers registered with osigaction, so weluoqi1999-10-111-1/+1
| | | | | | | | | | | | | | | can provide the correct context to each signal handler. Fix broken sigsuspend(): don't use p_oldsigmask as a flag, use SAS_OLDMASK as we did before the linuxthreads support merge (submitted by bde). Move ps_sigstk from to p_sigacts to the main proc structure since signal stack should not be shared among threads. Move SAS_OLDMASK and SAS_ALTSTACK flags from sigacts::ps_flags to proc::p_flag. Move PS_NOCLDSTOP and PS_NOCLDWAIT flags from proc::p_flag to procsig::ps_flag. Reviewed by: marcel, jdp, bde
* sigset_t change (part 4 of 5)marcel1999-09-291-56/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The compatibility code and/or emulators have been updated: iBCS2 now mostly uses the older syscalls. SVR4 now properly handles all signals. This has been achieved by using the new sigset_t throughout the emulator. The Linuxulator has been severely updated. Internally the new Linux sigset_t is made the default. These are then mapped to and from the new FreeBSD sigset_t. Also, rt_sigsuspend has been implemented in the Linuxulator. Implementing this syscall basicly caused all this sigset_t changing in the first place and the syscall has been used throughout the change as a means for testing. It basicly is too much work to undo the implementation so that it can later be added again. A special note on the use of sv_sigtbl and sv_sigsize in struct sysentvec: Every signal larger than sv_sigsize is not translated and is passed on to the signal handler unmodified. Signals in the range 1 upto and including sv_sigsize are translated. The rationale is that only the system defined signals need to be translated. The emulators also have been updated so that the translation tables are only indexed for valid (system defined) signals. This change also fixes the translation bug already in the SVR4 emulator.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add $Id$ tagsnewton1999-07-301-0/+2
|
* Rename struct members sa_siginfo. POSIX reserves identifiers startingcracauer1999-07-061-18/+18
| | | | | | | with sa_ when <signal.h> is included. They would conflict with the upcoming SA_SIGINFO implementation. Reviewed by: BDE
* Emulator KLD for SysVR4 executables grabbed from NetBSD.newton1999-01-301-0/+623
See http://www.freebsd.org/~newton/freebsd-svr4 for limitations, capabilities, history and TO-DO list.
OpenPOWER on IntegriCloud