diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-06 18:16:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:19 -0400 |
commit | 202e5979af4d91c7ca05892641131dee22653259 (patch) | |
tree | ba8443571add62bc93d29c1f6a3575381cccd167 /include | |
parent | 8dbfc5cfdcac04d656f6f6789eb8fcdcc3d2dfda (diff) |
[PATCH] compat: be more consistent about [ug]id_t
When I first wrote the compat layer patches, I was somewhat cavalier about
the definition of compat_uid_t and compat_gid_t (or maybe I just
misunderstood :-)). This patch makes the compat types much more consistent
with the types we are being compatible with and hopefully will fix a few
bugs along the way.
compat type type in compat arch
__compat_[ug]id_t __kernel_[ug]id_t
__compat_[ug]id32_t __kernel_[ug]id32_t
compat_[ug]id_t [ug]id_t
The difference is that compat_uid_t is always 32 bits (for the archs we
care about) but __compat_uid_t may be 16 bits on some.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ia64/compat.h | 20 | ||||
-rw-r--r-- | include/asm-mips/compat.h | 10 | ||||
-rw-r--r-- | include/asm-parisc/compat.h | 10 | ||||
-rw-r--r-- | include/asm-ppc64/compat.h | 18 | ||||
-rw-r--r-- | include/asm-s390/compat.h | 20 | ||||
-rw-r--r-- | include/asm-sparc64/compat.h | 18 | ||||
-rw-r--r-- | include/asm-x86_64/compat.h | 20 | ||||
-rw-r--r-- | include/linux/compat.h | 3 |
8 files changed, 65 insertions, 54 deletions
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h index 0c05e5bad8a0..aaf11f4e9169 100644 --- a/include/asm-ia64/compat.h +++ b/include/asm-ia64/compat.h | |||
@@ -13,10 +13,10 @@ typedef s32 compat_time_t; | |||
13 | typedef s32 compat_clock_t; | 13 | typedef s32 compat_clock_t; |
14 | typedef s32 compat_key_t; | 14 | typedef s32 compat_key_t; |
15 | typedef s32 compat_pid_t; | 15 | typedef s32 compat_pid_t; |
16 | typedef u16 compat_uid_t; | 16 | typedef u16 __compat_uid_t; |
17 | typedef u16 compat_gid_t; | 17 | typedef u16 __compat_gid_t; |
18 | typedef u32 compat_uid32_t; | 18 | typedef u32 __compat_uid32_t; |
19 | typedef u32 compat_gid32_t; | 19 | typedef u32 __compat_gid32_t; |
20 | typedef u16 compat_mode_t; | 20 | typedef u16 compat_mode_t; |
21 | typedef u32 compat_ino_t; | 21 | typedef u32 compat_ino_t; |
22 | typedef u16 compat_dev_t; | 22 | typedef u16 compat_dev_t; |
@@ -50,8 +50,8 @@ struct compat_stat { | |||
50 | compat_ino_t st_ino; | 50 | compat_ino_t st_ino; |
51 | compat_mode_t st_mode; | 51 | compat_mode_t st_mode; |
52 | compat_nlink_t st_nlink; | 52 | compat_nlink_t st_nlink; |
53 | compat_uid_t st_uid; | 53 | __compat_uid_t st_uid; |
54 | compat_gid_t st_gid; | 54 | __compat_gid_t st_gid; |
55 | compat_dev_t st_rdev; | 55 | compat_dev_t st_rdev; |
56 | u16 __pad2; | 56 | u16 __pad2; |
57 | u32 st_size; | 57 | u32 st_size; |
@@ -120,10 +120,10 @@ typedef u32 compat_sigset_word; | |||
120 | 120 | ||
121 | struct compat_ipc64_perm { | 121 | struct compat_ipc64_perm { |
122 | compat_key_t key; | 122 | compat_key_t key; |
123 | compat_uid32_t uid; | 123 | __compat_uid32_t uid; |
124 | compat_gid32_t gid; | 124 | __compat_gid32_t gid; |
125 | compat_uid32_t cuid; | 125 | __compat_uid32_t cuid; |
126 | compat_gid32_t cgid; | 126 | __compat_gid32_t cgid; |
127 | unsigned short mode; | 127 | unsigned short mode; |
128 | unsigned short __pad1; | 128 | unsigned short __pad1; |
129 | unsigned short seq; | 129 | unsigned short seq; |
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index d78002afb1e1..2c084cd4bc0a 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h | |||
@@ -15,8 +15,10 @@ typedef s32 compat_clock_t; | |||
15 | typedef s32 compat_suseconds_t; | 15 | typedef s32 compat_suseconds_t; |
16 | 16 | ||
17 | typedef s32 compat_pid_t; | 17 | typedef s32 compat_pid_t; |
18 | typedef s32 compat_uid_t; | 18 | typedef u32 __compat_uid_t; |
19 | typedef s32 compat_gid_t; | 19 | typedef u32 __compat_gid_t; |
20 | typedef u32 __compat_uid32_t; | ||
21 | typedef u32 __compat_gid32_t; | ||
20 | typedef u32 compat_mode_t; | 22 | typedef u32 compat_mode_t; |
21 | typedef u32 compat_ino_t; | 23 | typedef u32 compat_ino_t; |
22 | typedef u32 compat_dev_t; | 24 | typedef u32 compat_dev_t; |
@@ -52,8 +54,8 @@ struct compat_stat { | |||
52 | compat_ino_t st_ino; | 54 | compat_ino_t st_ino; |
53 | compat_mode_t st_mode; | 55 | compat_mode_t st_mode; |
54 | compat_nlink_t st_nlink; | 56 | compat_nlink_t st_nlink; |
55 | compat_uid_t st_uid; | 57 | __compat_uid32_t st_uid; |
56 | compat_gid_t st_gid; | 58 | __compat_gid32_t st_gid; |
57 | compat_dev_t st_rdev; | 59 | compat_dev_t st_rdev; |
58 | s32 st_pad2[2]; | 60 | s32 st_pad2[2]; |
59 | compat_off_t st_size; | 61 | compat_off_t st_size; |
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h index 7630d1ad2391..38b918feead9 100644 --- a/include/asm-parisc/compat.h +++ b/include/asm-parisc/compat.h | |||
@@ -13,8 +13,10 @@ typedef s32 compat_ssize_t; | |||
13 | typedef s32 compat_time_t; | 13 | typedef s32 compat_time_t; |
14 | typedef s32 compat_clock_t; | 14 | typedef s32 compat_clock_t; |
15 | typedef s32 compat_pid_t; | 15 | typedef s32 compat_pid_t; |
16 | typedef u32 compat_uid_t; | 16 | typedef u32 __compat_uid_t; |
17 | typedef u32 compat_gid_t; | 17 | typedef u32 __compat_gid_t; |
18 | typedef u32 __compat_uid32_t; | ||
19 | typedef u32 __compat_gid32_t; | ||
18 | typedef u16 compat_mode_t; | 20 | typedef u16 compat_mode_t; |
19 | typedef u32 compat_ino_t; | 21 | typedef u32 compat_ino_t; |
20 | typedef u32 compat_dev_t; | 22 | typedef u32 compat_dev_t; |
@@ -67,8 +69,8 @@ struct compat_stat { | |||
67 | compat_dev_t st_realdev; | 69 | compat_dev_t st_realdev; |
68 | u16 st_basemode; | 70 | u16 st_basemode; |
69 | u16 st_spareshort; | 71 | u16 st_spareshort; |
70 | compat_uid_t st_uid; | 72 | __compat_uid32_t st_uid; |
71 | compat_gid_t st_gid; | 73 | __compat_gid32_t st_gid; |
72 | u32 st_spare4[3]; | 74 | u32 st_spare4[3]; |
73 | }; | 75 | }; |
74 | 76 | ||
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h index 12414f5fc666..6ec62cd2d1d1 100644 --- a/include/asm-ppc64/compat.h +++ b/include/asm-ppc64/compat.h | |||
@@ -13,8 +13,10 @@ typedef s32 compat_ssize_t; | |||
13 | typedef s32 compat_time_t; | 13 | typedef s32 compat_time_t; |
14 | typedef s32 compat_clock_t; | 14 | typedef s32 compat_clock_t; |
15 | typedef s32 compat_pid_t; | 15 | typedef s32 compat_pid_t; |
16 | typedef u32 compat_uid_t; | 16 | typedef u32 __compat_uid_t; |
17 | typedef u32 compat_gid_t; | 17 | typedef u32 __compat_gid_t; |
18 | typedef u32 __compat_uid32_t; | ||
19 | typedef u32 __compat_gid32_t; | ||
18 | typedef u32 compat_mode_t; | 20 | typedef u32 compat_mode_t; |
19 | typedef u32 compat_ino_t; | 21 | typedef u32 compat_ino_t; |
20 | typedef u32 compat_dev_t; | 22 | typedef u32 compat_dev_t; |
@@ -48,8 +50,8 @@ struct compat_stat { | |||
48 | compat_ino_t st_ino; | 50 | compat_ino_t st_ino; |
49 | compat_mode_t st_mode; | 51 | compat_mode_t st_mode; |
50 | compat_nlink_t st_nlink; | 52 | compat_nlink_t st_nlink; |
51 | compat_uid_t st_uid; | 53 | __compat_uid32_t st_uid; |
52 | compat_gid_t st_gid; | 54 | __compat_gid32_t st_gid; |
53 | compat_dev_t st_rdev; | 55 | compat_dev_t st_rdev; |
54 | compat_off_t st_size; | 56 | compat_off_t st_size; |
55 | compat_off_t st_blksize; | 57 | compat_off_t st_blksize; |
@@ -144,10 +146,10 @@ static inline void __user *compat_alloc_user_space(long len) | |||
144 | */ | 146 | */ |
145 | struct compat_ipc64_perm { | 147 | struct compat_ipc64_perm { |
146 | compat_key_t key; | 148 | compat_key_t key; |
147 | compat_uid_t uid; | 149 | __compat_uid_t uid; |
148 | compat_gid_t gid; | 150 | __compat_gid_t gid; |
149 | compat_uid_t cuid; | 151 | __compat_uid_t cuid; |
150 | compat_gid_t cgid; | 152 | __compat_gid_t cgid; |
151 | compat_mode_t mode; | 153 | compat_mode_t mode; |
152 | unsigned int seq; | 154 | unsigned int seq; |
153 | unsigned int __pad2; | 155 | unsigned int __pad2; |
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h index 7f8f544eb262..a007715f4aea 100644 --- a/include/asm-s390/compat.h +++ b/include/asm-s390/compat.h | |||
@@ -13,10 +13,10 @@ typedef s32 compat_ssize_t; | |||
13 | typedef s32 compat_time_t; | 13 | typedef s32 compat_time_t; |
14 | typedef s32 compat_clock_t; | 14 | typedef s32 compat_clock_t; |
15 | typedef s32 compat_pid_t; | 15 | typedef s32 compat_pid_t; |
16 | typedef u16 compat_uid_t; | 16 | typedef u16 __compat_uid_t; |
17 | typedef u16 compat_gid_t; | 17 | typedef u16 __compat_gid_t; |
18 | typedef u32 compat_uid32_t; | 18 | typedef u32 __compat_uid32_t; |
19 | typedef u32 compat_gid32_t; | 19 | typedef u32 __compat_gid32_t; |
20 | typedef u16 compat_mode_t; | 20 | typedef u16 compat_mode_t; |
21 | typedef u32 compat_ino_t; | 21 | typedef u32 compat_ino_t; |
22 | typedef u16 compat_dev_t; | 22 | typedef u16 compat_dev_t; |
@@ -51,8 +51,8 @@ struct compat_stat { | |||
51 | compat_ino_t st_ino; | 51 | compat_ino_t st_ino; |
52 | compat_mode_t st_mode; | 52 | compat_mode_t st_mode; |
53 | compat_nlink_t st_nlink; | 53 | compat_nlink_t st_nlink; |
54 | compat_uid_t st_uid; | 54 | __compat_uid_t st_uid; |
55 | compat_gid_t st_gid; | 55 | __compat_gid_t st_gid; |
56 | compat_dev_t st_rdev; | 56 | compat_dev_t st_rdev; |
57 | u16 __pad2; | 57 | u16 __pad2; |
58 | u32 st_size; | 58 | u32 st_size; |
@@ -140,10 +140,10 @@ static inline void __user *compat_alloc_user_space(long len) | |||
140 | 140 | ||
141 | struct compat_ipc64_perm { | 141 | struct compat_ipc64_perm { |
142 | compat_key_t key; | 142 | compat_key_t key; |
143 | compat_uid32_t uid; | 143 | __compat_uid32_t uid; |
144 | compat_gid32_t gid; | 144 | __compat_gid32_t gid; |
145 | compat_uid32_t cuid; | 145 | __compat_uid32_t cuid; |
146 | compat_gid32_t cgid; | 146 | __compat_gid32_t cgid; |
147 | compat_mode_t mode; | 147 | compat_mode_t mode; |
148 | unsigned short __pad1; | 148 | unsigned short __pad1; |
149 | unsigned short seq; | 149 | unsigned short seq; |
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index b59122dd176d..c73935dc7ba1 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h | |||
@@ -12,8 +12,10 @@ typedef s32 compat_ssize_t; | |||
12 | typedef s32 compat_time_t; | 12 | typedef s32 compat_time_t; |
13 | typedef s32 compat_clock_t; | 13 | typedef s32 compat_clock_t; |
14 | typedef s32 compat_pid_t; | 14 | typedef s32 compat_pid_t; |
15 | typedef u16 compat_uid_t; | 15 | typedef u16 __compat_uid_t; |
16 | typedef u16 compat_gid_t; | 16 | typedef u16 __compat_gid_t; |
17 | typedef u32 __compat_uid32_t; | ||
18 | typedef u32 __compat_gid32_t; | ||
17 | typedef u16 compat_mode_t; | 19 | typedef u16 compat_mode_t; |
18 | typedef u32 compat_ino_t; | 20 | typedef u32 compat_ino_t; |
19 | typedef u16 compat_dev_t; | 21 | typedef u16 compat_dev_t; |
@@ -47,8 +49,8 @@ struct compat_stat { | |||
47 | compat_ino_t st_ino; | 49 | compat_ino_t st_ino; |
48 | compat_mode_t st_mode; | 50 | compat_mode_t st_mode; |
49 | compat_nlink_t st_nlink; | 51 | compat_nlink_t st_nlink; |
50 | compat_uid_t st_uid; | 52 | __compat_uid_t st_uid; |
51 | compat_gid_t st_gid; | 53 | __compat_gid_t st_gid; |
52 | compat_dev_t st_rdev; | 54 | compat_dev_t st_rdev; |
53 | compat_off_t st_size; | 55 | compat_off_t st_size; |
54 | compat_time_t st_atime; | 56 | compat_time_t st_atime; |
@@ -177,10 +179,10 @@ static __inline__ void __user *compat_alloc_user_space(long len) | |||
177 | 179 | ||
178 | struct compat_ipc64_perm { | 180 | struct compat_ipc64_perm { |
179 | compat_key_t key; | 181 | compat_key_t key; |
180 | __kernel_uid_t uid; | 182 | __compat_uid32_t uid; |
181 | __kernel_gid_t gid; | 183 | __compat_gid32_t gid; |
182 | __kernel_uid_t cuid; | 184 | __compat_uid32_t cuid; |
183 | __kernel_gid_t cgid; | 185 | __compat_gid32_t cgid; |
184 | unsigned short __pad1; | 186 | unsigned short __pad1; |
185 | compat_mode_t mode; | 187 | compat_mode_t mode; |
186 | unsigned short __pad2; | 188 | unsigned short __pad2; |
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h index d0f453c5adfc..f0155c38f639 100644 --- a/include/asm-x86_64/compat.h +++ b/include/asm-x86_64/compat.h | |||
@@ -14,10 +14,10 @@ typedef s32 compat_ssize_t; | |||
14 | typedef s32 compat_time_t; | 14 | typedef s32 compat_time_t; |
15 | typedef s32 compat_clock_t; | 15 | typedef s32 compat_clock_t; |
16 | typedef s32 compat_pid_t; | 16 | typedef s32 compat_pid_t; |
17 | typedef u16 compat_uid_t; | 17 | typedef u16 __compat_uid_t; |
18 | typedef u16 compat_gid_t; | 18 | typedef u16 __compat_gid_t; |
19 | typedef u32 compat_uid32_t; | 19 | typedef u32 __compat_uid32_t; |
20 | typedef u32 compat_gid32_t; | 20 | typedef u32 __compat_gid32_t; |
21 | typedef u16 compat_mode_t; | 21 | typedef u16 compat_mode_t; |
22 | typedef u32 compat_ino_t; | 22 | typedef u32 compat_ino_t; |
23 | typedef u16 compat_dev_t; | 23 | typedef u16 compat_dev_t; |
@@ -52,8 +52,8 @@ struct compat_stat { | |||
52 | compat_ino_t st_ino; | 52 | compat_ino_t st_ino; |
53 | compat_mode_t st_mode; | 53 | compat_mode_t st_mode; |
54 | compat_nlink_t st_nlink; | 54 | compat_nlink_t st_nlink; |
55 | compat_uid_t st_uid; | 55 | __compat_uid_t st_uid; |
56 | compat_gid_t st_gid; | 56 | __compat_gid_t st_gid; |
57 | compat_dev_t st_rdev; | 57 | compat_dev_t st_rdev; |
58 | u16 __pad2; | 58 | u16 __pad2; |
59 | u32 st_size; | 59 | u32 st_size; |
@@ -122,10 +122,10 @@ typedef u32 compat_sigset_word; | |||
122 | 122 | ||
123 | struct compat_ipc64_perm { | 123 | struct compat_ipc64_perm { |
124 | compat_key_t key; | 124 | compat_key_t key; |
125 | compat_uid32_t uid; | 125 | __compat_uid32_t uid; |
126 | compat_gid32_t gid; | 126 | __compat_gid32_t gid; |
127 | compat_uid32_t cuid; | 127 | __compat_uid32_t cuid; |
128 | compat_gid32_t cgid; | 128 | __compat_gid32_t cgid; |
129 | unsigned short mode; | 129 | unsigned short mode; |
130 | unsigned short __pad1; | 130 | unsigned short __pad1; |
131 | unsigned short seq; | 131 | unsigned short seq; |
diff --git a/include/linux/compat.h b/include/linux/compat.h index b58b7d6f2fdb..f9ca534787e2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -18,6 +18,9 @@ | |||
18 | #define compat_jiffies_to_clock_t(x) \ | 18 | #define compat_jiffies_to_clock_t(x) \ |
19 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | 19 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) |
20 | 20 | ||
21 | typedef __compat_uid32_t compat_uid_t; | ||
22 | typedef __compat_gid32_t compat_gid_t; | ||
23 | |||
21 | struct rusage; | 24 | struct rusage; |
22 | 25 | ||
23 | struct compat_itimerspec { | 26 | struct compat_itimerspec { |