Skip to content

Commit

Permalink
ipc: fix double sem unlock in semctl error path
Browse files Browse the repository at this point in the history
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 16df367 ("ipc,sem: do not hold ipc lock more
than necessary")

Acked-by: Davidlohr Bueso <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed May 5, 2013
1 parent 4091fd9 commit fbfd1d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid,
err = security_sem_semctl(sma, cmd);
if (err) {
rcu_read_unlock();
goto out_unlock;
goto out_up;
}

switch(cmd){
Expand Down

0 comments on commit fbfd1d2

Please sign in to comment.