summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-06 09:25:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-06 09:25:36 -0700
commitb6d199cc7eb5f57c8681cfd3156d17dd4151acfb (patch)
tree82cae68573e24cbb238e57594f40f98f0324389e
parentda0504fc84c0a8a3c21412fc92795035350c827a (diff)
sparse: annotate signal handler and ss_sp as user pointers
-rw-r--r--include/asm-i386/signal.h13
-rw-r--r--include/asm-ppc64/signal.h14
-rw-r--r--kernel/signal.c6
3 files changed, 22 insertions, 11 deletions
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index e3397cd6f77b..de3da5b31077 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -4,6 +4,7 @@
#include <linux/types.h>
#include <linux/linkage.h>
#include <linux/time.h>
+#include <linux/compiler.h>
/* Avoid too many header ordering problems. */
struct siginfo;
@@ -128,7 +129,11 @@ typedef unsigned long sigset_t;
#define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
@@ -139,13 +144,13 @@ struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestore_t sa_restorer;
};
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */
};
@@ -171,7 +176,7 @@ struct sigaction {
#endif /* __KERNEL__ */
typedef struct sigaltstack {
- void *ss_sp;
+ void __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
diff --git a/include/asm-ppc64/signal.h b/include/asm-ppc64/signal.h
index 7cd1f9a09d71..fe5401adb41b 100644
--- a/include/asm-ppc64/signal.h
+++ b/include/asm-ppc64/signal.h
@@ -2,6 +2,7 @@
#define _ASMPPC64_SIGNAL_H
#include <linux/types.h>
+#include <linux/compiler.h>
#include <asm/siginfo.h>
/* Avoid too many header ordering problems. */
@@ -114,7 +115,12 @@ typedef struct {
#define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */
-typedef void (*__sighandler_t)(int);
+typedef void __sigfunction(int);
+typedef __sigfunction __user * __sighandler_t;
+
+/* Type of the restorer function */
+typedef void __sigrestorer(void);
+typedef __sigrestorer __user * __sigrestorer_t;
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
@@ -124,13 +130,13 @@ struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestorer_t sa_restorer;
};
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestorer_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */
};
@@ -139,7 +145,7 @@ struct k_sigaction {
};
typedef struct sigaltstack {
- void *ss_sp;
+ void __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
diff --git a/kernel/signal.c b/kernel/signal.c
index 7a8cc4687c71..6ea3d407e323 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -157,7 +157,7 @@ static kmem_cache_t *sigqueue_cachep;
static int sig_ignored(struct task_struct *t, int sig)
{
- void * handler;
+ void __user * handler;
/*
* Tracers always want to know about signals..
@@ -2362,13 +2362,13 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
int error;
if (uoss) {
- oss.ss_sp = (void *) current->sas_ss_sp;
+ oss.ss_sp = (void __user *) current->sas_ss_sp;
oss.ss_size = current->sas_ss_size;
oss.ss_flags = sas_ss_flags(sp);
}
if (uss) {
- void *ss_sp;
+ void __user *ss_sp;
size_t ss_size;
int ss_flags;