History log of /freebsd-9.3-release/sys/i386/ibcs2/ibcs2_signal.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 225617 16-Sep-2011 kmacy

In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.

Reviewed by: rwatson
Approved by: re (bz)


# 141815 13-Feb-2005 sobomax

Backout previous change (disabling of security checks for signals delivered
in emulation layers), since it appears to be too broad.

Requested by: rwatson


# 141812 13-Feb-2005 sobomax

Split out kill(2) syscall service routine into user-level and kernel part, the
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


# 139799 06-Jan-2005 imp

/* -> /*- for license, add FreeBSD tag


# 121016 12-Oct-2003 tjr

Fix a multitude of security bugs in the iBCS2 emulator:
- 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 ibcs2_emul_find();
other calls to stackgap_alloc() have not been changed since they
are small fixed-size allocations.
- Replace use of strcpy() with strlcpy() in exec_coff_imgact()
to avoid buffer overflow
- Use strlcat() instead of strcat() to avoid a one byte buffer
overflow in ibcs2_setipdomainname()
- Use copyinstr() instead of copyin() in ibcs2_setipdomainname()
to ensure that the string is null-terminated
- Avoid integer overflow in ibcs2_setgroups() and ibcs2_setgroups()
by checking that gidsetsize argument is non-negative and
no larger than NGROUPS_MAX.
- Range-check signal numbers in ibcs2_wait(), ibcs2_sigaction(),
ibcs2_sigsys() and ibcs2_kill() to avoid accessing array past
the end (or before the start)


# 115684 02-Jun-2003 obrien

Use __FBSDID().


# 113859 22-Apr-2003 jhb

- Replace inline implementations of sigprocmask() with calls to
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.


# 112888 31-Mar-2003 jeff

- Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
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.


# 107849 13-Dec-2002 alfred

SCARGS removal take II.


# 107839 13-Dec-2002 alfred

Backout removal SCARGS, the code freeze is only "selectively" over.


# 107838 13-Dec-2002 alfred

Remove SCARGS.

Reviewed by: md5


# 104306 01-Oct-2002 jmallett

Back our kernel support for reliable signal queues.

Requested by: rwatson, phk, and many others


# 104266 01-Oct-2002 jmallett

Add a missing include.


# 104264 01-Oct-2002 jmallett

When working with sigset_t's, and needing to perform masking operations based
on a process's pending signals, use the signal queue flattener,
ksiginfo_to_sigset_t, on the process, and on a local sigset_t, and then work
with that as needed.


# 102412 25-Aug-2002 charnier

Replace various spelling with FALLTHROUGH which is lint()able


# 93793 04-Apr-2002 bde

Moved signal handling and rescheduling from userret() to ast() so that
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


# 92761 20-Mar-2002 alfred

Remove __P.


# 83366 12-Sep-2001 julian

KSE Milestone 2
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


# 76166 01-May-2001 markm

Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
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)


# 71489 23-Jan-2001 jhb

Proc locking.


# 52084 10-Oct-1999 marcel

Avoid using the osig* syscalls.


# 51793 29-Sep-1999 marcel

sigset_t change (part 4 of 5)
-----------------------------

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.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48620 06-Jul-1999 cracauer

Rename struct members sa_siginfo. POSIX reserves identifiers starting
with sa_ when <signal.h> is included. They would conflict with the
upcoming SA_SIGINFO implementation.

Reviewed by: BDE


# 30994 06-Nov-1997 phk

Move the "retval" (3rd) parameter from all syscall functions and put
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.


# 27537 20-Jul-1997 bde

Removed unused #includes.


# 24203 24-Mar-1997 bde

Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include
it when it is not used. In most cases, the reasons for including it
went away when the special ioctl headers became self-sufficient.


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 20203 08-Dec-1996 swallace

Perform special sigset() check.
Make sure signal is not blocked. If it is, return SIG_HOLD instead
of handler and unblock the signal.


# 11628 21-Oct-1995 swallace

In bsd_to_ibcs2_sigaction(), flag for ibcs2 system should be
IBCS2_SA_NOCLDSTOP and not SA_NOCLDSTOP.

Submitted by: bde


# 11605 21-Oct-1995 swallace

sigset() should have sa_flags cleared to sig is maked before calling
handler (remove SA_NODEFER).

On the other hand, signal() case should set sa_flags to SA_NODEFER as
in previous change.

In addition, added #ifdef'd code for signal() to or in SA_RESETHAND
flag for when that compatability is implemented.


# 11574 19-Oct-1995 swallace

Use sa_flag option SA_NODEFER in sigsys() emulation because SVR3
does not automatically mask signal upon delivery.


# 11397 10-Oct-1995 swallace

Remove old files no longer needed.
Add new files created for emulator.
Modify NetBSD import to work with FreeBSD and add new features and
code. The complete emulator is essentially a combination of work/code
implemented by Sean Eric Fagan, Soren Schmidt, Scott Bartram, and myself,
Steven Wallace.

Features of this new emulator system include:

o "clean" code, including strict prototyping.
o Auto-generation of ibcs2 system calls, xenix system calls, isc system
calls. Generation includes system tables, structure definitions,
and prototyping of function calls.
o ibcs2 emulator does not rely on any COMPAT_43 system calls.
o embedded socksys support
o ibcs2 msgsys, semsys, shmsys calls supported if supported in kernel
o alternate /emul/ibcs2 namespace searched first for files in ibcs2
system. Usefull to keep sysv libraries, binaries in /emul/ibcs2.
o many other finer details and functions fixed or implemented.


# 8876 30-May-1995 rgrimes

Remove trailing whitespace.


# 3584 14-Oct-1994 sos

iBCS2 emulator core files.

This is the main files for the iBCS2 emulator. It can be use
compiled into the kernel by using:

options IBCS2
options COMPAT_IBCS2

or as a lkm module using:

options COMPAT_IBCS2

and then loading it via the ibcs2 script in /usr/bin

REMEMBER: this code is still experimental ! NO WARRENTY !

Submitted by: sef@kithrup.com, mostyn@mrl.com, sos@kmd-ac.dk