Skip to contentSkip to conversation

fix logic error in ipc compat semctl()

PATCH New Alexander Graf 1 participant 1 message Jun 29, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix logic error in ipc compat semctl()

Hi,

when calling a semctl(IPC_STAT) without IPC_64 the check if the memory is unevaluated. This patch fixes this.

ipc/compat.c +1 -1
Index: linux/ipc/compat.c
===================================================================
@@ -225,7 +225,7 @@ static inline int put_compat_semid_ds(st
        int err;
 
        if (!access_ok (VERIFY_WRITE, up, sizeof(*up)))
-               err = -EFAULT;
+               return -EFAULT;
        err  = __put_compat_ipc_perm(&s->sem_perm, &up->sem_perm);
        err |= __put_user(s->sem_otime, &up->sem_otime);
        err |= __put_user(s->sem_ctime, &up->sem_ctime);