Commit fbfd1d28 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

ipc: fix double sem unlock in semctl error path

Fix another ipc locking buglet introduced by the scalability patches:
when semctl_down() was changed to delay the semaphore locking, one error
path for security_sem_semctl() went through the semaphore unlock logic
even though the semaphore had never been locked.

Introduced by commit 16df3674

 ("ipc,sem: do not hold ipc lock more
than necessary")
Acked-by: default avatarDavidlohr Bueso <>
Cc: Rik van Riel <>
Cc: Al Viro <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4091fd94
......@@ -1280,7 +1280,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid,
err = security_sem_semctl(sma, cmd);
if (err) {
goto out_unlock;
goto out_up;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment