Commit b6d199cc authored by Linus Torvalds's avatar Linus Torvalds

sparse: annotate signal handler and ss_sp as user pointers

parent da0504fc
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/compiler.h>
/* Avoid too many header ordering problems. */ /* Avoid too many header ordering problems. */
struct siginfo; struct siginfo;
...@@ -128,7 +129,11 @@ typedef unsigned long sigset_t; ...@@ -128,7 +129,11 @@ typedef unsigned long sigset_t;
#define SIG_SETMASK 2 /* for setting the signal mask */ #define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */ /* 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_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
...@@ -139,13 +144,13 @@ struct old_sigaction { ...@@ -139,13 +144,13 @@ struct old_sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
old_sigset_t sa_mask; old_sigset_t sa_mask;
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); __sigrestore_t sa_restorer;
}; };
struct sigaction { struct sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
...@@ -171,7 +176,7 @@ struct sigaction { ...@@ -171,7 +176,7 @@ struct sigaction {
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
typedef struct sigaltstack { typedef struct sigaltstack {
void *ss_sp; void __user *ss_sp;
int ss_flags; int ss_flags;
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _ASMPPC64_SIGNAL_H #define _ASMPPC64_SIGNAL_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/compiler.h>
#include <asm/siginfo.h> #include <asm/siginfo.h>
/* Avoid too many header ordering problems. */ /* Avoid too many header ordering problems. */
...@@ -114,7 +115,12 @@ typedef struct { ...@@ -114,7 +115,12 @@ typedef struct {
#define SIG_SETMASK 2 /* for setting the signal mask */ #define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */ /* 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_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
...@@ -124,13 +130,13 @@ struct old_sigaction { ...@@ -124,13 +130,13 @@ struct old_sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
old_sigset_t sa_mask; old_sigset_t sa_mask;
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); __sigrestorer_t sa_restorer;
}; };
struct sigaction { struct sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); __sigrestorer_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
...@@ -139,7 +145,7 @@ struct k_sigaction { ...@@ -139,7 +145,7 @@ struct k_sigaction {
}; };
typedef struct sigaltstack { typedef struct sigaltstack {
void *ss_sp; void __user *ss_sp;
int ss_flags; int ss_flags;
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;
......
...@@ -157,7 +157,7 @@ static kmem_cache_t *sigqueue_cachep; ...@@ -157,7 +157,7 @@ static kmem_cache_t *sigqueue_cachep;
static int sig_ignored(struct task_struct *t, int sig) static int sig_ignored(struct task_struct *t, int sig)
{ {
void * handler; void __user * handler;
/* /*
* Tracers always want to know about signals.. * 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 ...@@ -2362,13 +2362,13 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
int error; int error;
if (uoss) { 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_size = current->sas_ss_size;
oss.ss_flags = sas_ss_flags(sp); oss.ss_flags = sas_ss_flags(sp);
} }
if (uss) { if (uss) {
void *ss_sp; void __user *ss_sp;
size_t ss_size; size_t ss_size;
int ss_flags; int ss_flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment