Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

compat: move compat_siginfo_t definition to asm/compat.h

This is a preparatory patch for the introduction of NT_SIGINFO elf note.

Make the location of compat_siginfo_t uniform across eight architectures
which have it. Now it can be pulled in by including asm/compat.h or
linux/compat.h.

Most of the copies are verbatim. compat_uid[32]_t had to be replaced by
__compat_uid[32]_t. compat_uptr_t had to be moved up before
compat_siginfo_t in asm/compat.h on a several architectures (tile already
had it moved up). compat_sigval_t had to be relocated from linux/compat.h
to asm/compat.h.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: "Jonathan M. Foote" <jmfoote@cert.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Denys Vlasenko and committed by
Linus Torvalds
751f409d 5ab1c309

+513 -476
+59 -1
arch/arm64/include/asm/compat.h
··· 55 55 typedef u32 compat_uint_t; 56 56 typedef u32 compat_ulong_t; 57 57 typedef u64 compat_u64; 58 + typedef u32 compat_uptr_t; 58 59 59 60 struct compat_timespec { 60 61 compat_time_t tv_sec; ··· 131 130 132 131 typedef u32 compat_sigset_word; 133 132 133 + typedef union compat_sigval { 134 + compat_int_t sival_int; 135 + compat_uptr_t sival_ptr; 136 + } compat_sigval_t; 137 + 138 + typedef struct compat_siginfo { 139 + int si_signo; 140 + int si_errno; 141 + int si_code; 142 + 143 + union { 144 + /* The padding is the same size as AArch64. */ 145 + int _pad[128/sizeof(int) - 3]; 146 + 147 + /* kill() */ 148 + struct { 149 + compat_pid_t _pid; /* sender's pid */ 150 + __compat_uid32_t _uid; /* sender's uid */ 151 + } _kill; 152 + 153 + /* POSIX.1b timers */ 154 + struct { 155 + compat_timer_t _tid; /* timer id */ 156 + int _overrun; /* overrun count */ 157 + compat_sigval_t _sigval; /* same as below */ 158 + int _sys_private; /* not to be passed to user */ 159 + } _timer; 160 + 161 + /* POSIX.1b signals */ 162 + struct { 163 + compat_pid_t _pid; /* sender's pid */ 164 + __compat_uid32_t _uid; /* sender's uid */ 165 + compat_sigval_t _sigval; 166 + } _rt; 167 + 168 + /* SIGCHLD */ 169 + struct { 170 + compat_pid_t _pid; /* which child */ 171 + __compat_uid32_t _uid; /* sender's uid */ 172 + int _status; /* exit code */ 173 + compat_clock_t _utime; 174 + compat_clock_t _stime; 175 + } _sigchld; 176 + 177 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 178 + struct { 179 + compat_uptr_t _addr; /* faulting insn/memory ref. */ 180 + short _addr_lsb; /* LSB of the reported address */ 181 + } _sigfault; 182 + 183 + /* SIGPOLL */ 184 + struct { 185 + compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 186 + int _fd; 187 + } _sigpoll; 188 + } _sifields; 189 + } compat_siginfo_t; 190 + 134 191 #define COMPAT_OFF_T_MAX 0x7fffffff 135 192 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 136 193 ··· 198 139 * as pointers because the syscall entry code will have 199 140 * appropriately converted them already. 200 141 */ 201 - typedef u32 compat_uptr_t; 202 142 203 143 static inline void __user *compat_ptr(compat_uptr_t uptr) 204 144 {
-53
arch/arm64/kernel/signal32.c
··· 30 30 #include <asm/uaccess.h> 31 31 #include <asm/unistd.h> 32 32 33 - typedef struct compat_siginfo { 34 - int si_signo; 35 - int si_errno; 36 - int si_code; 37 - 38 - union { 39 - /* The padding is the same size as AArch64. */ 40 - int _pad[SI_PAD_SIZE]; 41 - 42 - /* kill() */ 43 - struct { 44 - compat_pid_t _pid; /* sender's pid */ 45 - __compat_uid32_t _uid; /* sender's uid */ 46 - } _kill; 47 - 48 - /* POSIX.1b timers */ 49 - struct { 50 - compat_timer_t _tid; /* timer id */ 51 - int _overrun; /* overrun count */ 52 - compat_sigval_t _sigval; /* same as below */ 53 - int _sys_private; /* not to be passed to user */ 54 - } _timer; 55 - 56 - /* POSIX.1b signals */ 57 - struct { 58 - compat_pid_t _pid; /* sender's pid */ 59 - __compat_uid32_t _uid; /* sender's uid */ 60 - compat_sigval_t _sigval; 61 - } _rt; 62 - 63 - /* SIGCHLD */ 64 - struct { 65 - compat_pid_t _pid; /* which child */ 66 - __compat_uid32_t _uid; /* sender's uid */ 67 - int _status; /* exit code */ 68 - compat_clock_t _utime; 69 - compat_clock_t _stime; 70 - } _sigchld; 71 - 72 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 73 - struct { 74 - compat_uptr_t _addr; /* faulting insn/memory ref. */ 75 - short _addr_lsb; /* LSB of the reported address */ 76 - } _sigfault; 77 - 78 - /* SIGPOLL */ 79 - struct { 80 - compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 81 - int _fd; 82 - } _sigpoll; 83 - } _sifields; 84 - } compat_siginfo_t; 85 - 86 33 struct compat_sigaction { 87 34 compat_uptr_t sa_handler; 88 35 compat_ulong_t sa_flags;
-62
arch/mips/include/asm/compat-signal.h
··· 10 10 11 11 #include <asm/uaccess.h> 12 12 13 - #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 14 - 15 - typedef struct compat_siginfo { 16 - int si_signo; 17 - int si_code; 18 - int si_errno; 19 - 20 - union { 21 - int _pad[SI_PAD_SIZE32]; 22 - 23 - /* kill() */ 24 - struct { 25 - compat_pid_t _pid; /* sender's pid */ 26 - compat_uid_t _uid; /* sender's uid */ 27 - } _kill; 28 - 29 - /* SIGCHLD */ 30 - struct { 31 - compat_pid_t _pid; /* which child */ 32 - compat_uid_t _uid; /* sender's uid */ 33 - int _status; /* exit code */ 34 - compat_clock_t _utime; 35 - compat_clock_t _stime; 36 - } _sigchld; 37 - 38 - /* IRIX SIGCHLD */ 39 - struct { 40 - compat_pid_t _pid; /* which child */ 41 - compat_clock_t _utime; 42 - int _status; /* exit code */ 43 - compat_clock_t _stime; 44 - } _irix_sigchld; 45 - 46 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 47 - struct { 48 - s32 _addr; /* faulting insn/memory ref. */ 49 - } _sigfault; 50 - 51 - /* SIGPOLL, SIGXFSZ (To do ...) */ 52 - struct { 53 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 54 - int _fd; 55 - } _sigpoll; 56 - 57 - /* POSIX.1b timers */ 58 - struct { 59 - timer_t _tid; /* timer id */ 60 - int _overrun; /* overrun count */ 61 - compat_sigval_t _sigval;/* same as below */ 62 - int _sys_private; /* not to be passed to user */ 63 - } _timer; 64 - 65 - /* POSIX.1b signals */ 66 - struct { 67 - compat_pid_t _pid; /* sender's pid */ 68 - compat_uid_t _uid; /* sender's uid */ 69 - compat_sigval_t _sigval; 70 - } _rt; 71 - 72 - } _sifields; 73 - } compat_siginfo_t; 74 - 75 13 static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, 76 14 const sigset_t *s) 77 15 {
+68 -1
arch/mips/include/asm/compat.h
··· 43 43 typedef u32 compat_uint_t; 44 44 typedef u32 compat_ulong_t; 45 45 typedef u64 compat_u64; 46 + typedef u32 compat_uptr_t; 46 47 47 48 struct compat_timespec { 48 49 compat_time_t tv_sec; ··· 125 124 126 125 typedef u32 compat_sigset_word; 127 126 127 + typedef union compat_sigval { 128 + compat_int_t sival_int; 129 + compat_uptr_t sival_ptr; 130 + } compat_sigval_t; 131 + 132 + #define SI_PAD_SIZE32 (128/sizeof(int) - 3) 133 + 134 + typedef struct compat_siginfo { 135 + int si_signo; 136 + int si_code; 137 + int si_errno; 138 + 139 + union { 140 + int _pad[SI_PAD_SIZE32]; 141 + 142 + /* kill() */ 143 + struct { 144 + compat_pid_t _pid; /* sender's pid */ 145 + __compat_uid_t _uid; /* sender's uid */ 146 + } _kill; 147 + 148 + /* SIGCHLD */ 149 + struct { 150 + compat_pid_t _pid; /* which child */ 151 + __compat_uid_t _uid; /* sender's uid */ 152 + int _status; /* exit code */ 153 + compat_clock_t _utime; 154 + compat_clock_t _stime; 155 + } _sigchld; 156 + 157 + /* IRIX SIGCHLD */ 158 + struct { 159 + compat_pid_t _pid; /* which child */ 160 + compat_clock_t _utime; 161 + int _status; /* exit code */ 162 + compat_clock_t _stime; 163 + } _irix_sigchld; 164 + 165 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 166 + struct { 167 + s32 _addr; /* faulting insn/memory ref. */ 168 + } _sigfault; 169 + 170 + /* SIGPOLL, SIGXFSZ (To do ...) */ 171 + struct { 172 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 173 + int _fd; 174 + } _sigpoll; 175 + 176 + /* POSIX.1b timers */ 177 + struct { 178 + timer_t _tid; /* timer id */ 179 + int _overrun; /* overrun count */ 180 + compat_sigval_t _sigval;/* same as below */ 181 + int _sys_private; /* not to be passed to user */ 182 + } _timer; 183 + 184 + /* POSIX.1b signals */ 185 + struct { 186 + compat_pid_t _pid; /* sender's pid */ 187 + __compat_uid_t _uid; /* sender's uid */ 188 + compat_sigval_t _sigval; 189 + } _rt; 190 + 191 + } _sifields; 192 + } compat_siginfo_t; 193 + 128 194 #define COMPAT_OFF_T_MAX 0x7fffffff 129 195 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 130 196 ··· 201 133 * as pointers because the syscall entry code will have 202 134 * appropriately converted them already. 203 135 */ 204 - typedef u32 compat_uptr_t; 205 136 206 137 static inline void __user *compat_ptr(compat_uptr_t uptr) 207 138 {
+58 -1
arch/parisc/include/asm/compat.h
··· 36 36 typedef u32 compat_uint_t; 37 37 typedef u32 compat_ulong_t; 38 38 typedef u64 compat_u64; 39 + typedef u32 compat_uptr_t; 39 40 40 41 struct compat_timespec { 41 42 compat_time_t tv_sec; ··· 128 127 129 128 typedef u32 compat_sigset_word; 130 129 130 + typedef union compat_sigval { 131 + compat_int_t sival_int; 132 + compat_uptr_t sival_ptr; 133 + } compat_sigval_t; 134 + 135 + typedef struct compat_siginfo { 136 + int si_signo; 137 + int si_errno; 138 + int si_code; 139 + 140 + union { 141 + int _pad[128/sizeof(int) - 3]; 142 + 143 + /* kill() */ 144 + struct { 145 + unsigned int _pid; /* sender's pid */ 146 + unsigned int _uid; /* sender's uid */ 147 + } _kill; 148 + 149 + /* POSIX.1b timers */ 150 + struct { 151 + compat_timer_t _tid; /* timer id */ 152 + int _overrun; /* overrun count */ 153 + char _pad[sizeof(unsigned int) - sizeof(int)]; 154 + compat_sigval_t _sigval; /* same as below */ 155 + int _sys_private; /* not to be passed to user */ 156 + } _timer; 157 + 158 + /* POSIX.1b signals */ 159 + struct { 160 + unsigned int _pid; /* sender's pid */ 161 + unsigned int _uid; /* sender's uid */ 162 + compat_sigval_t _sigval; 163 + } _rt; 164 + 165 + /* SIGCHLD */ 166 + struct { 167 + unsigned int _pid; /* which child */ 168 + unsigned int _uid; /* sender's uid */ 169 + int _status; /* exit code */ 170 + compat_clock_t _utime; 171 + compat_clock_t _stime; 172 + } _sigchld; 173 + 174 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 175 + struct { 176 + unsigned int _addr; /* faulting insn/memory ref. */ 177 + } _sigfault; 178 + 179 + /* SIGPOLL */ 180 + struct { 181 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 182 + int _fd; 183 + } _sigpoll; 184 + } _sifields; 185 + } compat_siginfo_t; 186 + 131 187 #define COMPAT_OFF_T_MAX 0x7fffffff 132 188 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 133 189 ··· 194 136 * as pointers because the syscall entry code will have 195 137 * appropriately converted them already. 196 138 */ 197 - typedef u32 compat_uptr_t; 198 139 199 140 static inline void __user *compat_ptr(compat_uptr_t uptr) 200 141 {
-52
arch/parisc/kernel/signal32.h
··· 55 55 struct compat_sigaction sa; 56 56 }; 57 57 58 - typedef struct compat_siginfo { 59 - int si_signo; 60 - int si_errno; 61 - int si_code; 62 - 63 - union { 64 - int _pad[((128/sizeof(int)) - 3)]; 65 - 66 - /* kill() */ 67 - struct { 68 - unsigned int _pid; /* sender's pid */ 69 - unsigned int _uid; /* sender's uid */ 70 - } _kill; 71 - 72 - /* POSIX.1b timers */ 73 - struct { 74 - compat_timer_t _tid; /* timer id */ 75 - int _overrun; /* overrun count */ 76 - char _pad[sizeof(unsigned int) - sizeof(int)]; 77 - compat_sigval_t _sigval; /* same as below */ 78 - int _sys_private; /* not to be passed to user */ 79 - } _timer; 80 - 81 - /* POSIX.1b signals */ 82 - struct { 83 - unsigned int _pid; /* sender's pid */ 84 - unsigned int _uid; /* sender's uid */ 85 - compat_sigval_t _sigval; 86 - } _rt; 87 - 88 - /* SIGCHLD */ 89 - struct { 90 - unsigned int _pid; /* which child */ 91 - unsigned int _uid; /* sender's uid */ 92 - int _status; /* exit code */ 93 - compat_clock_t _utime; 94 - compat_clock_t _stime; 95 - } _sigchld; 96 - 97 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 98 - struct { 99 - unsigned int _addr; /* faulting insn/memory ref. */ 100 - } _sigfault; 101 - 102 - /* SIGPOLL */ 103 - struct { 104 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 105 - int _fd; 106 - } _sigpoll; 107 - } _sifields; 108 - } compat_siginfo_t; 109 - 110 58 int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); 111 59 int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); 112 60
+59 -1
arch/powerpc/include/asm/compat.h
··· 38 38 typedef u32 compat_uint_t; 39 39 typedef u32 compat_ulong_t; 40 40 typedef u64 compat_u64; 41 + typedef u32 compat_uptr_t; 41 42 42 43 struct compat_timespec { 43 44 compat_time_t tv_sec; ··· 115 114 116 115 typedef u32 compat_sigset_word; 117 116 117 + typedef union compat_sigval { 118 + compat_int_t sival_int; 119 + compat_uptr_t sival_ptr; 120 + } compat_sigval_t; 121 + 122 + #define SI_PAD_SIZE32 (128/sizeof(int) - 3) 123 + 124 + typedef struct compat_siginfo { 125 + int si_signo; 126 + int si_errno; 127 + int si_code; 128 + 129 + union { 130 + int _pad[SI_PAD_SIZE32]; 131 + 132 + /* kill() */ 133 + struct { 134 + compat_pid_t _pid; /* sender's pid */ 135 + __compat_uid_t _uid; /* sender's uid */ 136 + } _kill; 137 + 138 + /* POSIX.1b timers */ 139 + struct { 140 + compat_timer_t _tid; /* timer id */ 141 + int _overrun; /* overrun count */ 142 + compat_sigval_t _sigval; /* same as below */ 143 + int _sys_private; /* not to be passed to user */ 144 + } _timer; 145 + 146 + /* POSIX.1b signals */ 147 + struct { 148 + compat_pid_t _pid; /* sender's pid */ 149 + __compat_uid_t _uid; /* sender's uid */ 150 + compat_sigval_t _sigval; 151 + } _rt; 152 + 153 + /* SIGCHLD */ 154 + struct { 155 + compat_pid_t _pid; /* which child */ 156 + __compat_uid_t _uid; /* sender's uid */ 157 + int _status; /* exit code */ 158 + compat_clock_t _utime; 159 + compat_clock_t _stime; 160 + } _sigchld; 161 + 162 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ 163 + struct { 164 + unsigned int _addr; /* faulting insn/memory ref. */ 165 + } _sigfault; 166 + 167 + /* SIGPOLL */ 168 + struct { 169 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 170 + int _fd; 171 + } _sigpoll; 172 + } _sifields; 173 + } compat_siginfo_t; 174 + 118 175 #define COMPAT_OFF_T_MAX 0x7fffffff 119 176 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 120 177 ··· 182 123 * as pointers because the syscall entry code will have 183 124 * appropriately converted them already. 184 125 */ 185 - typedef u32 compat_uptr_t; 186 126 187 127 static inline void __user *compat_ptr(compat_uptr_t uptr) 188 128 {
-1
arch/powerpc/include/asm/siginfo.h
··· 10 10 11 11 #ifdef __powerpc64__ 12 12 # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 13 - # define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 14 13 #endif 15 14 16 15 #include <asm-generic/siginfo.h>
-51
arch/powerpc/kernel/ppc32.h
··· 16 16 17 17 /* These are here to support 32-bit syscalls on a 64-bit kernel. */ 18 18 19 - typedef struct compat_siginfo { 20 - int si_signo; 21 - int si_errno; 22 - int si_code; 23 - 24 - union { 25 - int _pad[SI_PAD_SIZE32]; 26 - 27 - /* kill() */ 28 - struct { 29 - compat_pid_t _pid; /* sender's pid */ 30 - compat_uid_t _uid; /* sender's uid */ 31 - } _kill; 32 - 33 - /* POSIX.1b timers */ 34 - struct { 35 - compat_timer_t _tid; /* timer id */ 36 - int _overrun; /* overrun count */ 37 - compat_sigval_t _sigval; /* same as below */ 38 - int _sys_private; /* not to be passed to user */ 39 - } _timer; 40 - 41 - /* POSIX.1b signals */ 42 - struct { 43 - compat_pid_t _pid; /* sender's pid */ 44 - compat_uid_t _uid; /* sender's uid */ 45 - compat_sigval_t _sigval; 46 - } _rt; 47 - 48 - /* SIGCHLD */ 49 - struct { 50 - compat_pid_t _pid; /* which child */ 51 - compat_uid_t _uid; /* sender's uid */ 52 - int _status; /* exit code */ 53 - compat_clock_t _utime; 54 - compat_clock_t _stime; 55 - } _sigchld; 56 - 57 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ 58 - struct { 59 - unsigned int _addr; /* faulting insn/memory ref. */ 60 - } _sigfault; 61 - 62 - /* SIGPOLL */ 63 - struct { 64 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 65 - int _fd; 66 - } _sigpoll; 67 - } _sifields; 68 - } compat_siginfo_t; 69 - 70 19 #define __old_sigaction32 old_sigaction32 71 20 72 21 struct __old_sigaction32 {
+74 -1
arch/s390/include/asm/compat.h
··· 65 65 typedef u32 compat_uint_t; 66 66 typedef u32 compat_ulong_t; 67 67 typedef u64 compat_u64; 68 + typedef u32 compat_uptr_t; 68 69 69 70 struct compat_timespec { 70 71 compat_time_t tv_sec; ··· 145 144 146 145 typedef u32 compat_sigset_word; 147 146 147 + typedef union compat_sigval { 148 + compat_int_t sival_int; 149 + compat_uptr_t sival_ptr; 150 + } compat_sigval_t; 151 + 152 + typedef struct compat_siginfo { 153 + int si_signo; 154 + int si_errno; 155 + int si_code; 156 + 157 + union { 158 + int _pad[128/sizeof(int) - 3]; 159 + 160 + /* kill() */ 161 + struct { 162 + pid_t _pid; /* sender's pid */ 163 + uid_t _uid; /* sender's uid */ 164 + } _kill; 165 + 166 + /* POSIX.1b timers */ 167 + struct { 168 + compat_timer_t _tid; /* timer id */ 169 + int _overrun; /* overrun count */ 170 + compat_sigval_t _sigval; /* same as below */ 171 + int _sys_private; /* not to be passed to user */ 172 + } _timer; 173 + 174 + /* POSIX.1b signals */ 175 + struct { 176 + pid_t _pid; /* sender's pid */ 177 + uid_t _uid; /* sender's uid */ 178 + compat_sigval_t _sigval; 179 + } _rt; 180 + 181 + /* SIGCHLD */ 182 + struct { 183 + pid_t _pid; /* which child */ 184 + uid_t _uid; /* sender's uid */ 185 + int _status;/* exit code */ 186 + compat_clock_t _utime; 187 + compat_clock_t _stime; 188 + } _sigchld; 189 + 190 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 191 + struct { 192 + __u32 _addr; /* faulting insn/memory ref. - pointer */ 193 + } _sigfault; 194 + 195 + /* SIGPOLL */ 196 + struct { 197 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 198 + int _fd; 199 + } _sigpoll; 200 + } _sifields; 201 + } compat_siginfo_t; 202 + 203 + /* 204 + * How these fields are to be accessed. 205 + */ 206 + #define si_pid _sifields._kill._pid 207 + #define si_uid _sifields._kill._uid 208 + #define si_status _sifields._sigchld._status 209 + #define si_utime _sifields._sigchld._utime 210 + #define si_stime _sifields._sigchld._stime 211 + #define si_value _sifields._rt._sigval 212 + #define si_int _sifields._rt._sigval.sival_int 213 + #define si_ptr _sifields._rt._sigval.sival_ptr 214 + #define si_addr _sifields._sigfault._addr 215 + #define si_band _sifields._sigpoll._band 216 + #define si_fd _sifields._sigpoll._fd 217 + #define si_tid _sifields._timer._tid 218 + #define si_overrun _sifields._timer._overrun 219 + 148 220 #define COMPAT_OFF_T_MAX 0x7fffffff 149 221 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 150 222 ··· 227 153 * as pointers because the syscall entry code will have 228 154 * appropriately converted them already. 229 155 */ 230 - typedef u32 compat_uptr_t; 231 156 232 157 static inline void __user *compat_ptr(compat_uptr_t uptr) 233 158 {
-68
arch/s390/kernel/compat_linux.h
··· 23 23 __u32 sa_flags; 24 24 __u32 sa_restorer; /* Another 32 bit pointer */ 25 25 }; 26 - 27 - typedef struct compat_siginfo { 28 - int si_signo; 29 - int si_errno; 30 - int si_code; 31 - 32 - union { 33 - int _pad[((128/sizeof(int)) - 3)]; 34 - 35 - /* kill() */ 36 - struct { 37 - pid_t _pid; /* sender's pid */ 38 - uid_t _uid; /* sender's uid */ 39 - } _kill; 40 - 41 - /* POSIX.1b timers */ 42 - struct { 43 - compat_timer_t _tid; /* timer id */ 44 - int _overrun; /* overrun count */ 45 - compat_sigval_t _sigval; /* same as below */ 46 - int _sys_private; /* not to be passed to user */ 47 - } _timer; 48 - 49 - /* POSIX.1b signals */ 50 - struct { 51 - pid_t _pid; /* sender's pid */ 52 - uid_t _uid; /* sender's uid */ 53 - compat_sigval_t _sigval; 54 - } _rt; 55 - 56 - /* SIGCHLD */ 57 - struct { 58 - pid_t _pid; /* which child */ 59 - uid_t _uid; /* sender's uid */ 60 - int _status;/* exit code */ 61 - compat_clock_t _utime; 62 - compat_clock_t _stime; 63 - } _sigchld; 64 - 65 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 66 - struct { 67 - __u32 _addr; /* faulting insn/memory ref. - pointer */ 68 - } _sigfault; 69 - 70 - /* SIGPOLL */ 71 - struct { 72 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 73 - int _fd; 74 - } _sigpoll; 75 - } _sifields; 76 - } compat_siginfo_t; 77 - 78 - /* 79 - * How these fields are to be accessed. 80 - */ 81 - #define si_pid _sifields._kill._pid 82 - #define si_uid _sifields._kill._uid 83 - #define si_status _sifields._sigchld._status 84 - #define si_utime _sifields._sigchld._utime 85 - #define si_stime _sifields._sigchld._stime 86 - #define si_value _sifields._rt._sigval 87 - #define si_int _sifields._rt._sigval.sival_int 88 - #define si_ptr _sifields._rt._sigval.sival_ptr 89 - #define si_addr _sifields._sigfault._addr 90 - #define si_band _sifields._sigpoll._band 91 - #define si_fd _sifields._sigpoll._fd 92 - #define si_tid _sifields._timer._tid 93 - #define si_overrun _sifields._timer._overrun 94 26 95 27 /* asm/sigcontext.h */ 96 28 typedef union
+60 -1
arch/sparc/include/asm/compat.h
··· 36 36 typedef u32 compat_uint_t; 37 37 typedef u32 compat_ulong_t; 38 38 typedef u64 compat_u64; 39 + typedef u32 compat_uptr_t; 39 40 40 41 struct compat_timespec { 41 42 compat_time_t tv_sec; ··· 148 147 149 148 typedef u32 compat_sigset_word; 150 149 150 + typedef union compat_sigval { 151 + compat_int_t sival_int; 152 + compat_uptr_t sival_ptr; 153 + } compat_sigval_t; 154 + 155 + #define SI_PAD_SIZE32 (128/sizeof(int) - 3) 156 + 157 + typedef struct compat_siginfo { 158 + int si_signo; 159 + int si_errno; 160 + int si_code; 161 + 162 + union { 163 + int _pad[SI_PAD_SIZE32]; 164 + 165 + /* kill() */ 166 + struct { 167 + compat_pid_t _pid; /* sender's pid */ 168 + unsigned int _uid; /* sender's uid */ 169 + } _kill; 170 + 171 + /* POSIX.1b timers */ 172 + struct { 173 + compat_timer_t _tid; /* timer id */ 174 + int _overrun; /* overrun count */ 175 + compat_sigval_t _sigval; /* same as below */ 176 + int _sys_private; /* not to be passed to user */ 177 + } _timer; 178 + 179 + /* POSIX.1b signals */ 180 + struct { 181 + compat_pid_t _pid; /* sender's pid */ 182 + unsigned int _uid; /* sender's uid */ 183 + compat_sigval_t _sigval; 184 + } _rt; 185 + 186 + /* SIGCHLD */ 187 + struct { 188 + compat_pid_t _pid; /* which child */ 189 + unsigned int _uid; /* sender's uid */ 190 + int _status; /* exit code */ 191 + compat_clock_t _utime; 192 + compat_clock_t _stime; 193 + } _sigchld; 194 + 195 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ 196 + struct { 197 + u32 _addr; /* faulting insn/memory ref. */ 198 + int _trapno; 199 + } _sigfault; 200 + 201 + /* SIGPOLL */ 202 + struct { 203 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 204 + int _fd; 205 + } _sigpoll; 206 + } _sifields; 207 + } compat_siginfo_t; 208 + 151 209 #define COMPAT_OFF_T_MAX 0x7fffffff 152 210 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 153 211 ··· 216 156 * as pointers because the syscall entry code will have 217 157 * appropriately converted them already. 218 158 */ 219 - typedef u32 compat_uptr_t; 220 159 221 160 static inline void __user *compat_ptr(compat_uptr_t uptr) 222 161 {
-1
arch/sparc/include/asm/siginfo.h
··· 3 3 4 4 #if defined(__sparc__) && defined(__arch64__) 5 5 6 - #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 7 6 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 8 7 #define __ARCH_SI_BAND_T int 9 8
-52
arch/sparc/kernel/signal32.c
··· 54 54 /* __siginfo_rwin_t * */u32 rwin_save; 55 55 } __attribute__((aligned(8))); 56 56 57 - typedef struct compat_siginfo{ 58 - int si_signo; 59 - int si_errno; 60 - int si_code; 61 - 62 - union { 63 - int _pad[SI_PAD_SIZE32]; 64 - 65 - /* kill() */ 66 - struct { 67 - compat_pid_t _pid; /* sender's pid */ 68 - unsigned int _uid; /* sender's uid */ 69 - } _kill; 70 - 71 - /* POSIX.1b timers */ 72 - struct { 73 - compat_timer_t _tid; /* timer id */ 74 - int _overrun; /* overrun count */ 75 - compat_sigval_t _sigval; /* same as below */ 76 - int _sys_private; /* not to be passed to user */ 77 - } _timer; 78 - 79 - /* POSIX.1b signals */ 80 - struct { 81 - compat_pid_t _pid; /* sender's pid */ 82 - unsigned int _uid; /* sender's uid */ 83 - compat_sigval_t _sigval; 84 - } _rt; 85 - 86 - /* SIGCHLD */ 87 - struct { 88 - compat_pid_t _pid; /* which child */ 89 - unsigned int _uid; /* sender's uid */ 90 - int _status; /* exit code */ 91 - compat_clock_t _utime; 92 - compat_clock_t _stime; 93 - } _sigchld; 94 - 95 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ 96 - struct { 97 - u32 _addr; /* faulting insn/memory ref. */ 98 - int _trapno; 99 - } _sigfault; 100 - 101 - /* SIGPOLL */ 102 - struct { 103 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 104 - int _fd; 105 - } _sigpoll; 106 - } _sifields; 107 - }compat_siginfo_t; 108 - 109 57 struct rt_signal_frame32 { 110 58 struct sparc_stackf32 ss; 111 59 compat_siginfo_t info;
+62
arch/tile/include/asm/compat.h
··· 110 110 111 111 typedef u32 compat_sigset_word; 112 112 113 + typedef union compat_sigval { 114 + compat_int_t sival_int; 115 + compat_uptr_t sival_ptr; 116 + } compat_sigval_t; 117 + 118 + #define COMPAT_SI_PAD_SIZE (128/sizeof(int) - 3) 119 + 120 + typedef struct compat_siginfo { 121 + int si_signo; 122 + int si_errno; 123 + int si_code; 124 + 125 + union { 126 + int _pad[COMPAT_SI_PAD_SIZE]; 127 + 128 + /* kill() */ 129 + struct { 130 + unsigned int _pid; /* sender's pid */ 131 + unsigned int _uid; /* sender's uid */ 132 + } _kill; 133 + 134 + /* POSIX.1b timers */ 135 + struct { 136 + compat_timer_t _tid; /* timer id */ 137 + int _overrun; /* overrun count */ 138 + compat_sigval_t _sigval; /* same as below */ 139 + int _sys_private; /* not to be passed to user */ 140 + int _overrun_incr; /* amount to add to overrun */ 141 + } _timer; 142 + 143 + /* POSIX.1b signals */ 144 + struct { 145 + unsigned int _pid; /* sender's pid */ 146 + unsigned int _uid; /* sender's uid */ 147 + compat_sigval_t _sigval; 148 + } _rt; 149 + 150 + /* SIGCHLD */ 151 + struct { 152 + unsigned int _pid; /* which child */ 153 + unsigned int _uid; /* sender's uid */ 154 + int _status; /* exit code */ 155 + compat_clock_t _utime; 156 + compat_clock_t _stime; 157 + } _sigchld; 158 + 159 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 160 + struct { 161 + unsigned int _addr; /* faulting insn/memory ref. */ 162 + #ifdef __ARCH_SI_TRAPNO 163 + int _trapno; /* TRAP # which caused the signal */ 164 + #endif 165 + } _sigfault; 166 + 167 + /* SIGPOLL */ 168 + struct { 169 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 170 + int _fd; 171 + } _sigpoll; 172 + } _sifields; 173 + } compat_siginfo_t; 174 + 113 175 #define COMPAT_OFF_T_MAX 0x7fffffff 114 176 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 115 177
-57
arch/tile/kernel/compat_signal.c
··· 55 55 sigset_t uc_sigmask; /* mask last for extensibility */ 56 56 }; 57 57 58 - #define COMPAT_SI_PAD_SIZE ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int)) 59 - 60 - struct compat_siginfo { 61 - int si_signo; 62 - int si_errno; 63 - int si_code; 64 - 65 - union { 66 - int _pad[COMPAT_SI_PAD_SIZE]; 67 - 68 - /* kill() */ 69 - struct { 70 - unsigned int _pid; /* sender's pid */ 71 - unsigned int _uid; /* sender's uid */ 72 - } _kill; 73 - 74 - /* POSIX.1b timers */ 75 - struct { 76 - compat_timer_t _tid; /* timer id */ 77 - int _overrun; /* overrun count */ 78 - compat_sigval_t _sigval; /* same as below */ 79 - int _sys_private; /* not to be passed to user */ 80 - int _overrun_incr; /* amount to add to overrun */ 81 - } _timer; 82 - 83 - /* POSIX.1b signals */ 84 - struct { 85 - unsigned int _pid; /* sender's pid */ 86 - unsigned int _uid; /* sender's uid */ 87 - compat_sigval_t _sigval; 88 - } _rt; 89 - 90 - /* SIGCHLD */ 91 - struct { 92 - unsigned int _pid; /* which child */ 93 - unsigned int _uid; /* sender's uid */ 94 - int _status; /* exit code */ 95 - compat_clock_t _utime; 96 - compat_clock_t _stime; 97 - } _sigchld; 98 - 99 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 100 - struct { 101 - unsigned int _addr; /* faulting insn/memory ref. */ 102 - #ifdef __ARCH_SI_TRAPNO 103 - int _trapno; /* TRAP # which caused the signal */ 104 - #endif 105 - } _sigfault; 106 - 107 - /* SIGPOLL */ 108 - struct { 109 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 110 - int _fd; 111 - } _sigpoll; 112 - } _sifields; 113 - }; 114 - 115 58 struct compat_rt_sigframe { 116 59 unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; /* caller save area */ 117 60 struct compat_siginfo info;
+73 -1
arch/x86/include/asm/compat.h
··· 41 41 typedef u32 compat_uint_t; 42 42 typedef u32 compat_ulong_t; 43 43 typedef u64 __attribute__((aligned(4))) compat_u64; 44 + typedef u32 compat_uptr_t; 44 45 45 46 struct compat_timespec { 46 47 compat_time_t tv_sec; ··· 124 123 #define _COMPAT_NSIG_BPW 32 125 124 126 125 typedef u32 compat_sigset_word; 126 + 127 + typedef union compat_sigval { 128 + compat_int_t sival_int; 129 + compat_uptr_t sival_ptr; 130 + } compat_sigval_t; 131 + 132 + typedef struct compat_siginfo { 133 + int si_signo; 134 + int si_errno; 135 + int si_code; 136 + 137 + union { 138 + int _pad[128/sizeof(int) - 3]; 139 + 140 + /* kill() */ 141 + struct { 142 + unsigned int _pid; /* sender's pid */ 143 + unsigned int _uid; /* sender's uid */ 144 + } _kill; 145 + 146 + /* POSIX.1b timers */ 147 + struct { 148 + compat_timer_t _tid; /* timer id */ 149 + int _overrun; /* overrun count */ 150 + compat_sigval_t _sigval; /* same as below */ 151 + int _sys_private; /* not to be passed to user */ 152 + int _overrun_incr; /* amount to add to overrun */ 153 + } _timer; 154 + 155 + /* POSIX.1b signals */ 156 + struct { 157 + unsigned int _pid; /* sender's pid */ 158 + unsigned int _uid; /* sender's uid */ 159 + compat_sigval_t _sigval; 160 + } _rt; 161 + 162 + /* SIGCHLD */ 163 + struct { 164 + unsigned int _pid; /* which child */ 165 + unsigned int _uid; /* sender's uid */ 166 + int _status; /* exit code */ 167 + compat_clock_t _utime; 168 + compat_clock_t _stime; 169 + } _sigchld; 170 + 171 + /* SIGCHLD (x32 version) */ 172 + struct { 173 + unsigned int _pid; /* which child */ 174 + unsigned int _uid; /* sender's uid */ 175 + int _status; /* exit code */ 176 + compat_s64 _utime; 177 + compat_s64 _stime; 178 + } _sigchld_x32; 179 + 180 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 181 + struct { 182 + unsigned int _addr; /* faulting insn/memory ref. */ 183 + } _sigfault; 184 + 185 + /* SIGPOLL */ 186 + struct { 187 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 188 + int _fd; 189 + } _sigpoll; 190 + 191 + struct { 192 + unsigned int _call_addr; /* calling insn */ 193 + int _syscall; /* triggering system call number */ 194 + unsigned int _arch; /* AUDIT_ARCH_* of syscall */ 195 + } _sigsys; 196 + } _sifields; 197 + } compat_siginfo_t; 127 198 128 199 #define COMPAT_OFF_T_MAX 0x7fffffff 129 200 #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL ··· 282 209 * as pointers because the syscall entry code will have 283 210 * appropriately converted them already. 284 211 */ 285 - typedef u32 compat_uptr_t; 286 212 287 213 static inline void __user *compat_ptr(compat_uptr_t uptr) 288 214 {
-67
arch/x86/include/asm/ia32.h
··· 86 86 unsigned long long st_ino; 87 87 } __attribute__((packed)); 88 88 89 - typedef struct compat_siginfo { 90 - int si_signo; 91 - int si_errno; 92 - int si_code; 93 - 94 - union { 95 - int _pad[((128 / sizeof(int)) - 3)]; 96 - 97 - /* kill() */ 98 - struct { 99 - unsigned int _pid; /* sender's pid */ 100 - unsigned int _uid; /* sender's uid */ 101 - } _kill; 102 - 103 - /* POSIX.1b timers */ 104 - struct { 105 - compat_timer_t _tid; /* timer id */ 106 - int _overrun; /* overrun count */ 107 - compat_sigval_t _sigval; /* same as below */ 108 - int _sys_private; /* not to be passed to user */ 109 - int _overrun_incr; /* amount to add to overrun */ 110 - } _timer; 111 - 112 - /* POSIX.1b signals */ 113 - struct { 114 - unsigned int _pid; /* sender's pid */ 115 - unsigned int _uid; /* sender's uid */ 116 - compat_sigval_t _sigval; 117 - } _rt; 118 - 119 - /* SIGCHLD */ 120 - struct { 121 - unsigned int _pid; /* which child */ 122 - unsigned int _uid; /* sender's uid */ 123 - int _status; /* exit code */ 124 - compat_clock_t _utime; 125 - compat_clock_t _stime; 126 - } _sigchld; 127 - 128 - /* SIGCHLD (x32 version) */ 129 - struct { 130 - unsigned int _pid; /* which child */ 131 - unsigned int _uid; /* sender's uid */ 132 - int _status; /* exit code */ 133 - compat_s64 _utime; 134 - compat_s64 _stime; 135 - } _sigchld_x32; 136 - 137 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 138 - struct { 139 - unsigned int _addr; /* faulting insn/memory ref. */ 140 - } _sigfault; 141 - 142 - /* SIGPOLL */ 143 - struct { 144 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ 145 - int _fd; 146 - } _sigpoll; 147 - 148 - struct { 149 - unsigned int _call_addr; /* calling insn */ 150 - int _syscall; /* triggering system call number */ 151 - unsigned int _arch; /* AUDIT_ARCH_* of syscall */ 152 - } _sigsys; 153 - } _sifields; 154 - } compat_siginfo_t; 155 - 156 89 #define IA32_STACK_TOP IA32_PAGE_OFFSET 157 90 158 91 #ifdef __KERNEL__
-5
include/linux/compat.h
··· 160 160 char f_fpack[6]; 161 161 }; 162 162 163 - typedef union compat_sigval { 164 - compat_int_t sival_int; 165 - compat_uptr_t sival_ptr; 166 - } compat_sigval_t; 167 - 168 163 #define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3) 169 164 170 165 typedef struct compat_sigevent {