summaryrefslogtreecommitdiff
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,
static long do_compat_semctl(int first, int second, int third, u32 pad)
{
- union semun fourth;
+ unsigned long fourth;
int err, err2;
struct semid64_ds s64;
struct semid64_ds __user *up64;
@@ -249,9 +249,13 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
memset(&s64, 0, sizeof(s64));
if ((third & (~IPC_64)) == SETVAL)
- fourth.val = (int) pad;
+#ifdef __BIG_ENDIAN
+ fourth = (unsigned long)pad << 32;
+#else
+ fourth = pad;
+#endif
else
- fourth.__pad = compat_ptr(pad);
+ fourth = (unsigned long)compat_ptr(pad);
switch (third & (~IPC_64)) {
case IPC_INFO:
case IPC_RMID:
@@ -269,7 +273,7 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
case IPC_STAT:
case SEM_STAT:
up64 = compat_alloc_user_space(sizeof(s64));
- fourth.__pad = up64;
+ fourth = (unsigned long)up64;
err = sys_semctl(first, second, third, fourth);
if (err < 0)
break;
@@ -295,7 +299,7 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
if (err)
break;
- fourth.__pad = up64;
+ fourth = (unsigned long)up64;
err = sys_semctl(first, second, third, fourth);
break;