aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/compat.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-05 15:04:55 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-03-05 15:14:16 -0500
commite1fd1f490fa4213bd3060efa823a39d299538f72 (patch)
tree8bed18bdf003822ef1a4946e734418cf88546c24 /ipc/compat.c
parent4b377bab29e6a241db42f27541e7fb63713ee178 (diff)
get rid of union semop in sys_semctl(2) arguments
just have the bugger take unsigned long and deal with SETVAL case (when we use an int member in the union) explicitly. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/compat.c')
-rw-r--r--ipc/compat.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ipc/compat.c b/ipc/compat.c
index 6cb6a4df86e4..892f6585dd60 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -240,7 +240,7 @@ static inline int put_compat_semid_ds(struct semid64_ds *s,
240 240
241static long do_compat_semctl(int first, int second, int third, u32 pad) 241static long do_compat_semctl(int first, int second, int third, u32 pad)
242{ 242{
243 union semun fourth; 243 unsigned long fourth;
244 int err, err2; 244 int err, err2;
245 struct semid64_ds s64; 245 struct semid64_ds s64;
246 struct semid64_ds __user *up64; 246 struct semid64_ds __user *up64;
@@ -249,9 +249,13 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
249 memset(&s64, 0, sizeof(s64)); 249 memset(&s64, 0, sizeof(s64));
250 250
251 if ((third & (~IPC_64)) == SETVAL) 251 if ((third & (~IPC_64)) == SETVAL)
252 fourth.val = (int) pad; 252#ifdef __BIG_ENDIAN
253 fourth = (unsigned long)pad << 32;
254#else
255 fourth = pad;
256#endif
253 else 257 else
254 fourth.__pad = compat_ptr(pad); 258 fourth = (unsigned long)compat_ptr(pad);
255 switch (third & (~IPC_64)) { 259 switch (third & (~IPC_64)) {
256 case IPC_INFO: 260 case IPC_INFO:
257 case IPC_RMID: 261 case IPC_RMID:
@@ -269,7 +273,7 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
269 case IPC_STAT: 273 case IPC_STAT:
270 case SEM_STAT: 274 case SEM_STAT:
271 up64 = compat_alloc_user_space(sizeof(s64)); 275 up64 = compat_alloc_user_space(sizeof(s64));
272 fourth.__pad = up64; 276 fourth = (unsigned long)up64;
273 err = sys_semctl(first, second, third, fourth); 277 err = sys_semctl(first, second, third, fourth);
274 if (err < 0) 278 if (err < 0)
275 break; 279 break;
@@ -295,7 +299,7 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
295 if (err) 299 if (err)
296 break; 300 break;
297 301
298 fourth.__pad = up64; 302 fourth = (unsigned long)up64;
299 err = sys_semctl(first, second, third, fourth); 303 err = sys_semctl(first, second, third, fourth);
300 break; 304 break;
301 305