summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/include/signal.h6
-rw-r--r--sys/alpha/linux/linux.h2
-rw-r--r--sys/alpha/linux/linux_sysvec.c3
-rw-r--r--sys/alpha/osf1/osf1.h1
-rw-r--r--sys/alpha/osf1/osf1_sysvec.c5
-rw-r--r--sys/amd64/include/signal.h6
-rw-r--r--sys/compat/svr4/svr4_signal.h2
-rw-r--r--sys/compat/svr4/svr4_sysvec.c4
-rw-r--r--sys/i386/ibcs2/ibcs2_signal.h2
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c4
-rw-r--r--sys/i386/include/signal.h6
-rw-r--r--sys/i386/linux/linux_machdep.c5
-rw-r--r--sys/i386/linux/linux_sysvec.c10
-rw-r--r--sys/ia64/include/signal.h6
-rw-r--r--sys/kern/imgact_aout.c4
-rw-r--r--sys/kern/imgact_elf.c4
-rw-r--r--sys/kern/kern_sig.c2
-rw-r--r--sys/sys/_sigset.h1
-rw-r--r--sys/sys/signal.h1
-rw-r--r--sys/sys/sysent.h1
20 files changed, 56 insertions, 19 deletions
diff --git a/sys/alpha/include/signal.h b/sys/alpha/include/signal.h
index 2e01864..02a4bfd 100644
--- a/sys/alpha/include/signal.h
+++ b/sys/alpha/include/signal.h
@@ -36,6 +36,12 @@ typedef long sig_atomic_t;
#ifndef _ANSI_SOURCE
/*
+ * Minimum signal stack size. The current signal frame
+ * for Alpha is 808 bytes large.
+ */
+#define MINSIGSTKSZ (1024 * 4)
+
+/*
* Information pushed on stack when a signal is delivered.
* This is used by the kernel to restore state following
* execution of the signal handler. It is also made available
diff --git a/sys/alpha/linux/linux.h b/sys/alpha/linux/linux.h
index c441cc2..507289b 100644
--- a/sys/alpha/linux/linux.h
+++ b/sys/alpha/linux/linux.h
@@ -159,6 +159,8 @@ struct linux_new_utsname {
#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig)
#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig)
+#define LINUX_MINSIGSTKSZ 4096
+
typedef void (*linux_handler_t)(int);
typedef u_long linux_osigset_t;
diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c
index 50ec18f..8b4e13c 100644
--- a/sys/alpha/linux/linux_sysvec.c
+++ b/sys/alpha/linux/linux_sysvec.c
@@ -186,7 +186,8 @@ struct sysentvec elf_linux_sysvec = {
0,
"Linux ELF",
elf_coredump,
- exec_linux_imgact_try
+ exec_linux_imgact_try,
+ LINUX_MINSIGSTKSZ
};
static Elf64_Brandinfo linux_brand = {
diff --git a/sys/alpha/osf1/osf1.h b/sys/alpha/osf1/osf1.h
index 7628bf0..bc91295 100644
--- a/sys/alpha/osf1/osf1.h
+++ b/sys/alpha/osf1/osf1.h
@@ -31,6 +31,7 @@ extern struct sysent osf1_sysent[];
extern int bsd_to_osf1_sig[];
extern int bsd_to_osf1_errno[];
+#define OSF1_MINSIGSTKSZ 4096
/* osf/1 ioctls */
#define OSF1_IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */
diff --git a/sys/alpha/osf1/osf1_sysvec.c b/sys/alpha/osf1/osf1_sysvec.c
index 45e9125..b89375a 100644
--- a/sys/alpha/osf1/osf1_sysvec.c
+++ b/sys/alpha/osf1/osf1_sysvec.c
@@ -74,8 +74,9 @@ struct sysentvec osf1_sysvec = {
&osf1_szsigcode, /* use generic trampoline size */
0, /* prepsyscall */
"OSF/1 ECOFF",
- NULL /* we don't have an ECOFF coredump function */
-
+ NULL, /* we don't have an ECOFF coredump function */
+ NULL,
+ OSF1_MINSIGSTKSZ
};
/*
diff --git a/sys/amd64/include/signal.h b/sys/amd64/include/signal.h
index e3f1b19..1e91f60 100644
--- a/sys/amd64/include/signal.h
+++ b/sys/amd64/include/signal.h
@@ -45,6 +45,12 @@ typedef int sig_atomic_t;
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+/*
+ * Minimum signal stack size. The current signal frame
+ * for i386 is 408 bytes large.
+ */
+#define MINSIGSTKSZ (512 * 4)
+
#include <machine/trap.h> /* codes for SIGILL, SIGFPE */
/*
diff --git a/sys/compat/svr4/svr4_signal.h b/sys/compat/svr4/svr4_signal.h
index 1549c83..f7b0b52 100644
--- a/sys/compat/svr4/svr4_signal.h
+++ b/sys/compat/svr4/svr4_signal.h
@@ -132,6 +132,8 @@ struct svr4_sigaltstack {
#define SVR4_SS_DISABLE 0x00000002
#define SVR4_SS_ALLBITS 0x00000003
+#define SVR4_MINSIGSTKSZ 8192
+
void bsd_to_svr4_sigaltstack __P((const struct sigaltstack *, struct svr4_sigaltstack *));
void bsd_to_svr4_sigset __P((const sigset_t *, svr4_sigset_t *));
void svr4_to_bsd_sigaltstack __P((const struct svr4_sigaltstack *, struct sigaltstack *));
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 9690a99..f314d1d 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -177,7 +177,9 @@ struct sysentvec svr4_sysvec = {
&svr4_szsigcode,
NULL,
"SVR4",
- elf_coredump
+ elf_coredump,
+ NULL,
+ SVR4_MINSIGSTKSZ
};
Elf32_Brandinfo svr4_brand = {
diff --git a/sys/i386/ibcs2/ibcs2_signal.h b/sys/i386/ibcs2/ibcs2_signal.h
index 2eadf6c..21df087 100644
--- a/sys/i386/ibcs2/ibcs2_signal.h
+++ b/sys/i386/ibcs2/ibcs2_signal.h
@@ -103,6 +103,8 @@ struct ibcs2_sigaction {
/* sa_flags */
#define IBCS2_SA_NOCLDSTOP 1
+#define IBCS2_MINSIGSTKSZ 8192
+
extern int bsd_to_ibcs2_sig[];
#endif /* _IBCS2_SIGNAL_H */
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index 027c990..3f08212 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -62,7 +62,9 @@ struct sysentvec ibcs2_svr3_sysvec = {
&szsigcode, /* use generic trampoline size */
0, /* prepsyscall */
"IBCS2 COFF",
- NULL /* we don't have a COFF coredump function */
+ NULL, /* we don't have a COFF coredump function */
+ NULL,
+ IBCS2_MINSIGSTKSZ
};
/*
diff --git a/sys/i386/include/signal.h b/sys/i386/include/signal.h
index e3f1b19..1e91f60 100644
--- a/sys/i386/include/signal.h
+++ b/sys/i386/include/signal.h
@@ -45,6 +45,12 @@ typedef int sig_atomic_t;
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+/*
+ * Minimum signal stack size. The current signal frame
+ * for i386 is 408 bytes large.
+ */
+#define MINSIGSTKSZ (512 * 4)
+
#include <machine/trap.h> /* codes for SIGILL, SIGFPE */
/*
diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c
index 6af8832..b95ce4c 100644
--- a/sys/i386/linux/linux_machdep.c
+++ b/sys/i386/linux/linux_machdep.c
@@ -668,8 +668,7 @@ linux_sigaltstack(p, uap)
ss = stackgap_alloc(&sg, sizeof(stack_t));
ss->ss_sp = lss.ss_sp;
- ss->ss_size = (lss.ss_size >= LINUX_MINSIGSTKSZ &&
- lss.ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss.ss_size;
+ ss->ss_size = lss.ss_size;
ss->ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags);
}
oss = (uap->uoss != NULL)
@@ -686,8 +685,6 @@ linux_sigaltstack(p, uap)
lss.ss_flags = bsd_to_linux_sigaltstack(oss->ss_flags);
error = copyout(&lss, uap->uoss, sizeof(linux_stack_t));
}
- if (!error && (ss != NULL) && (lss.ss_size < ss->ss_size))
- p->p_sigstk.ss_size = lss.ss_size;
return (error);
}
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index ee6ee7e..9129efb 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -633,15 +633,13 @@ linux_rt_sigreturn(p, args)
regs->tf_esp = context->sc_esp_at_signal;
regs->tf_ss = context->sc_ss;
-
/*
* call sigaltstack & ignore results..
*/
ss = stackgap_alloc(&sg, sizeof(stack_t));
lss = &uc.uc_stack;
ss->ss_sp = lss->ss_sp;
- ss->ss_size = (lss->ss_size >= LINUX_MINSIGSTKSZ &&
- lss->ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss->ss_size;
+ ss->ss_size = lss->ss_size;
ss->ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
#ifdef DEBUG
@@ -726,7 +724,8 @@ struct sysentvec linux_sysvec = {
linux_prepsyscall,
"Linux a.out",
aout_coredump,
- exec_linux_imgact_try
+ exec_linux_imgact_try,
+ LINUX_MINSIGSTKSZ
};
struct sysentvec elf_linux_sysvec = {
@@ -745,7 +744,8 @@ struct sysentvec elf_linux_sysvec = {
linux_prepsyscall,
"Linux ELF",
elf_coredump,
- exec_linux_imgact_try
+ exec_linux_imgact_try,
+ LINUX_MINSIGSTKSZ
};
static Elf32_Brandinfo linux_brand = {
diff --git a/sys/ia64/include/signal.h b/sys/ia64/include/signal.h
index e1602e4..268836c 100644
--- a/sys/ia64/include/signal.h
+++ b/sys/ia64/include/signal.h
@@ -35,6 +35,12 @@ typedef long sig_atomic_t;
#ifndef _ANSI_SOURCE
+/*
+ * Minimum signal stack size. The current signal frame
+ * for IA-64 is 2656 bytes large.
+ */
+#define MINSIGSTKSZ (3072 * 4)
+
#ifndef _IA64_FPREG_DEFINED
struct ia64_fpreg {
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 80ecc0c..e27a80c 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -69,7 +69,9 @@ struct sysentvec aout_sysvec = {
&szsigcode,
0,
"FreeBSD a.out",
- aout_coredump
+ aout_coredump,
+ NULL,
+ MINSIGSTKSZ
};
static int
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 069bc9a..9706d67 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -99,7 +99,9 @@ struct sysentvec elf_freebsd_sysvec = {
&szsigcode,
0,
"FreeBSD ELF",
- elf_coredump
+ elf_coredump,
+ NULL,
+ MINSIGSTKSZ
};
static Elf_Brandinfo freebsd_brand_info = {
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 00624d4..af7a32f 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -830,7 +830,7 @@ sigaltstack(p, uap)
p->p_sigstk.ss_flags = ss.ss_flags;
return (0);
}
- if (ss.ss_size < MINSIGSTKSZ)
+ if (ss.ss_size < p->p_sysent->sv_minsigstksz)
return (ENOMEM);
p->p_flag |= P_ALTSTACK;
p->p_sigstk = ss;
diff --git a/sys/sys/_sigset.h b/sys/sys/_sigset.h
index 2e405a2..e3bef90 100644
--- a/sys/sys/_sigset.h
+++ b/sys/sys/_sigset.h
@@ -238,7 +238,6 @@ typedef struct sigaltstack {
#define SS_ONSTACK 0x0001 /* take signal on alternate stack */
#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */
-#define MINSIGSTKSZ 8192 /* minimum allowable stack */
#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */
/* Have enough typedefs for this now. XXX */
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 2e405a2..e3bef90 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -238,7 +238,6 @@ typedef struct sigaltstack {
#define SS_ONSTACK 0x0001 /* take signal on alternate stack */
#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */
-#define MINSIGSTKSZ 8192 /* minimum allowable stack */
#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */
/* Have enough typedefs for this now. XXX */
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index fc06f77..93d356b 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -80,6 +80,7 @@ struct sysentvec {
off_t));
/* function to dump core, or NULL */
int (*sv_imgact_try) __P((struct image_params *));
+ int sv_minsigstksz; /* minimum signal stack size */
};
#ifdef _KERNEL
OpenPOWER on IntegriCloud