Skip to content

Commit d57d973

Browse files
agrafLinus Torvalds
authored andcommitted
fix logic error in ipc compat semctl()
When calling a semctl(IPC_STAT) without IPC_64 the check if the memory is unevaluated. This patch fixes this. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0db19c4 commit d57d973

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎ipc/compat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static inline int put_compat_semid_ds(struct semid64_ds *s,
225225
int err;
226226

227227
if (!access_ok (VERIFY_WRITE, up, sizeof(*up)))
228-
err = -EFAULT;
228+
return -EFAULT;
229229
err = __put_compat_ipc_perm(&s->sem_perm, &up->sem_perm);
230230
err |= __put_user(s->sem_otime, &up->sem_otime);
231231
err |= __put_user(s->sem_ctime, &up->sem_ctime);

0 commit comments

Comments
 (0)