From a369cc139fbe807fbf433e212b853c56ed446324 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 30 Aug 2003 08:30:00 -0700 Subject: [PATCH] [SPARC64]: In sysv IPC translation, mask out IPC_64 as appropriate. Based upon a patch from Keith M Wesolowski --- arch/sparc64/kernel/sys_sparc32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index e87a575b63f93..fe64eda04546f 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -388,7 +388,7 @@ struct shmid64_ds32 { * * This is really horribly ugly. */ -#define IPCOP_MASK(__x) (1UL << (__x)) +#define IPCOP_MASK(__x) (1UL << ((__x)&~IPC_64)) static int do_sys32_semctl(int first, int second, int third, void *uptr) { union semun fourth; @@ -400,7 +400,7 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr) err = -EFAULT; if (get_user (pad, (u32 *)uptr)) goto out; - if(third == SETVAL) + if ((third & ~IPC_64) == SETVAL) fourth.val = (int)pad; else fourth.__pad = (void *)A(pad); -- 2.53.0