summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-11-22 21:13:31 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-11-22 21:13:31 +0000
commite4ec26f0e2b58c6d24ed72b18ed6ad64ad7fbf22 (patch)
tree840338b7df523d0d4888563e5c568c42009293f9
parent22b74528e2a12e785f4b8987aea532f5584265ec (diff)
sigstack() is long dead, and the compat sigaltstack syscall is gone too.
Correct the namespace protections for sigreturn(), sigwait(), and psignal() ok millert@
-rw-r--r--include/signal.h11
-rw-r--r--lib/libc/arch/m68k/gen/setjmp.S4
-rw-r--r--lib/libc/arch/mips64/gen/setjmp.S4
-rw-r--r--lib/libc/arch/powerpc/gen/setjmp.S4
-rw-r--r--lib/libc/arch/sparc/gen/setjmp.S4
-rw-r--r--lib/libc/arch/vax/gen/setjmp.S4
-rw-r--r--lib/libc/compat-43/sigvec.37
-rw-r--r--lib/libc/sys/Makefile.inc4
-rw-r--r--lib/libc/sys/sigstack.250
-rw-r--r--sys/sys/signal.h18
10 files changed, 22 insertions, 88 deletions
diff --git a/include/signal.h b/include/signal.h
index 5e61629e122..2553bc828d0 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.h,v 1.15 2011/07/06 17:39:22 guenther Exp $ */
+/* $OpenBSD: signal.h,v 1.16 2011/11/22 21:13:30 guenther Exp $ */
/* $NetBSD: signal.h,v 1.8 1996/02/29 00:04:57 jtc Exp $ */
/*-
@@ -105,19 +105,20 @@ __only_inline int sigismember(const sigset_t *set, int signo) {
int killpg(pid_t, int);
int siginterrupt(int, int);
int sigpause(int);
-int sigreturn(struct sigcontext *);
-int sigstack(const struct sigstack *, struct sigstack *);
int sigaltstack(const struct sigaltstack *, struct sigaltstack *);
#if __BSD_VISIBLE
-void psignal(unsigned int, const char *);
int sigblock(int);
+int sigreturn(struct sigcontext *);
int sigsetmask(int);
int sigvec(int, struct sigvec *, struct sigvec *);
#endif
+#endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 199309 || __XPG_VISIBLE >= 500
int sigwait(const sigset_t *, int *);
#endif
-#endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
+void psignal(unsigned int, const char *);
+#endif
#endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */
__END_DECLS
diff --git a/lib/libc/arch/m68k/gen/setjmp.S b/lib/libc/arch/m68k/gen/setjmp.S
index dac41aa5398..01ab2b39d76 100644
--- a/lib/libc/arch/m68k/gen/setjmp.S
+++ b/lib/libc/arch/m68k/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: setjmp.S,v 1.5 2011/11/22 21:13:30 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -46,7 +46,7 @@
#include "DEFS.h"
ENTRY(setjmp)
- subl #12,sp /* space for sigstack args/rvals */
+ subl #12,sp /* space for sigaltstack args/rvals */
clrl sp@ /* don't change it... */
movl sp,sp@(4) /* ...but return the current val */
jbsr _sigaltstack /* note: flags returned in sp@(8) */
diff --git a/lib/libc/arch/mips64/gen/setjmp.S b/lib/libc/arch/mips64/gen/setjmp.S
index b534105b154..156c25046da 100644
--- a/lib/libc/arch/mips64/gen/setjmp.S
+++ b/lib/libc/arch/mips64/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.6 2009/12/11 05:10:15 miod Exp $ */
+/* $OpenBSD: setjmp.S,v 1.7 2011/11/22 21:13:30 guenther Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -68,7 +68,7 @@ NON_LEAF(setjmp, FRAMESZ, ra)
and v1, v1, 1 # extract onstack flag
REG_S v1, SC_ONSTACK(a0) # save it in sc_onstack
REG_L ra, RAOFF(sp)
- blt v0, zero, botch # check for sigstack() error
+ blt v0, zero, botch # check for sigaltstack() error
REG_S ra, SC_PC(a0) # sc_pc = return address
#if defined(__mips64)
dli v0, 0xACEDBADE # sigcontext magic number
diff --git a/lib/libc/arch/powerpc/gen/setjmp.S b/lib/libc/arch/powerpc/gen/setjmp.S
index 01fde9d28e7..98bed38f84b 100644
--- a/lib/libc/arch/powerpc/gen/setjmp.S
+++ b/lib/libc/arch/powerpc/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.5 2004/03/01 18:05:50 drahn Exp $ */
+/* $OpenBSD: setjmp.S,v 1.6 2011/11/22 21:13:30 guenther Exp $ */
/*
* Copyright (c) 1996 Dale Rahn. All rights reserved.
*
@@ -66,7 +66,7 @@ ENTRY(setjmp)
li 3, 0
bl PIC_PLT(sigblock)
stw 3, JMP_sig(31)
- /* should sigstack be checked and saved */
+ /* should sigaltstack be checked and saved */
mr 3, 31
lwz 0, JMP_lr(3)
mtlr 0
diff --git a/lib/libc/arch/sparc/gen/setjmp.S b/lib/libc/arch/sparc/gen/setjmp.S
index 10cc2932ac7..c16d8d70028 100644
--- a/lib/libc/arch/sparc/gen/setjmp.S
+++ b/lib/libc/arch/sparc/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: setjmp.S,v 1.6 2011/11/22 21:13:30 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -58,7 +58,7 @@ ENTRY(setjmp)
t ST_SYSCALL
st %o0, [%o2 + 4] /* sc.sc_mask = current mask; */
mov SYS_sigaltstack, %g1
- clr %o0 /* sigstack(NULL, &foo) */
+ clr %o0 /* sigaltstack(NULL, &foo) */
add %sp, 0x48, %o1 /* (foo being in arg dump area) */
t ST_SYSCALL
ld [%sp + 0x50], %o0 /* foo.ss_flags */
diff --git a/lib/libc/arch/vax/gen/setjmp.S b/lib/libc/arch/vax/gen/setjmp.S
index ad931fd1691..2903134f530 100644
--- a/lib/libc/arch/vax/gen/setjmp.S
+++ b/lib/libc/arch/vax/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.7 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: setjmp.S,v 1.8 2011/11/22 21:13:30 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -43,7 +43,7 @@
ENTRY(setjmp, R6)
movl 4(ap),r6 # construct sigcontext
- subl2 $12,sp # space for current struct sigstack
+ subl2 $12,sp # space for current struct sigaltstack
pushl sp # get current values
pushl $0 # no new values
calls $4,_C_LABEL(sigaltstack)# pop args plus signal stack value
diff --git a/lib/libc/compat-43/sigvec.3 b/lib/libc/compat-43/sigvec.3
index ecfb8ed661a..05dca966761 100644
--- a/lib/libc/compat-43/sigvec.3
+++ b/lib/libc/compat-43/sigvec.3
@@ -25,9 +25,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: sigvec.3,v 1.29 2011/09/03 23:40:15 jmc Exp $
+.\" $OpenBSD: sigvec.3,v 1.30 2011/11/22 21:13:30 guenther Exp $
.\"
-.Dd $Mdocdate: September 3 2011 $
+.Dd $Mdocdate: November 22 2011 $
.Dt SIGVEC 3
.Os
.Sh NAME
@@ -172,7 +172,7 @@ bit is set in
the system will deliver the signal to the process on a
.Em "signal stack" ,
specified with
-.Xr sigstack 2 .
+.Xr sigaltstack 2 .
.Pp
If a signal is caught during the system calls listed below,
the call may be restarted,
@@ -310,7 +310,6 @@ or
.Xr sigaction 2 ,
.Xr sigaltstack 2 ,
.Xr sigprocmask 2 ,
-.Xr sigstack 2 ,
.Xr sigsuspend 2 ,
.Xr setjmp 3 ,
.Xr sigblock 3 ,
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 9c7618565ff..2902075c49e 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.95 2011/10/16 06:21:52 guenther Exp $
+# $OpenBSD: Makefile.inc,v 1.96 2011/11/22 21:13:30 guenther Exp $
# $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93
@@ -234,7 +234,7 @@ MAN+= accept.2 access.2 acct.2 adjfreq.2 adjtime.2 bind.2 brk.2 chdir.2 \
recv.2 rename.2 revoke.2 rfork.2 rmdir.2 select.2 send.2 setgroups.2 \
setpgid.2 setregid.2 setreuid.2 setresuid.2 setsid.2 setuid.2 \
shutdown.2 sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 \
- sigreturn.2 sigstack.2 sigsuspend.2 socket.2 socketpair.2 stat.2 \
+ sigreturn.2 sigsuspend.2 socket.2 socketpair.2 stat.2 \
statfs.2 swapctl.2 symlink.2 sync.2 sysarch.2 syscall.2 truncate.2 \
umask.2 unlink.2 utimes.2 vfork.2 wait.2 write.2
diff --git a/lib/libc/sys/sigstack.2 b/lib/libc/sys/sigstack.2
deleted file mode 100644
index cfe2d5453b4..00000000000
--- a/lib/libc/sys/sigstack.2
+++ /dev/null
@@ -1,50 +0,0 @@
-.\" $OpenBSD: sigstack.2,v 1.6 2007/05/31 19:19:34 jmc Exp $
-.\" $NetBSD: sigstack.2,v 1.5 1995/02/27 13:21:35 cgd Exp $
-.\"
-.\" Copyright (c) 1983, 1992, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)sigstack.2 8.1 (Berkeley) 6/4/93
-.\"
-.Dd $Mdocdate: May 31 2007 $
-.Dt SIGSTACK 2
-.Os
-.Sh NAME
-.Nm sigstack
-.Nd set and/or get signal stack context
-.Sh DESCRIPTION
-The
-.Fn sigstack
-function has been deprecated in favor of the interface described in
-.Xr sigaltstack 2 .
-.Sh SEE ALSO
-.Xr sigaltstack 2
-.Sh HISTORY
-The
-.Nm
-function call appeared in
-.Bx 4.2 .
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 3aa0eb4b877..8f8e032f8d8 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.h,v 1.22 2011/07/06 17:39:22 guenther Exp $ */
+/* $OpenBSD: signal.h,v 1.23 2011/11/22 21:13:30 guenther Exp $ */
/* $NetBSD: signal.h,v 1.21 1996/02/09 18:25:32 christos Exp $ */
/*
@@ -169,14 +169,6 @@ struct sigvec {
#if __BSD_VISIBLE || __XPG_VISIBLE >= 420
/*
- * Structure used in sigstack call.
- */
-struct sigstack {
- void *ss_sp; /* signal stack pointer */
- int ss_onstack; /* current status */
-};
-
-/*
* Structure used in sigaltstack call.
*/
typedef struct sigaltstack {
@@ -189,14 +181,6 @@ typedef struct sigaltstack {
#define MINSIGSTKSZ 8192 /* minimum allowable stack */
#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */
-#ifdef _KERNEL
-struct osigaltstack {
- void *ss_sp; /* signal stack base */
- int ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-};
-#endif
-
typedef struct sigcontext ucontext_t;
#endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */