aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/sem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-04 13:25:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-04 20:19:59 -0400
commitfbfd1d2862a8316c7191bc551c6a842e6918abb0 (patch)
tree06c5a391238bcf93bb3d7f2c587d069eeb6809e5 /ipc/sem.c
parent4091fd942e96af5a0b1dfa6aac5f44153ebf7cdb (diff)
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 16df3674efe3 ("ipc,sem: do not hold ipc lock more than necessary") Acked-by: Davidlohr Bueso <davidlohr.bueso@hp.com> Cc: Rik van Riel <riel@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/sem.c')
-rw-r--r--ipc/sem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 8f5aa34f8d30..1f8f01a542de 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1280,7 +1280,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid,
1280 err = security_sem_semctl(sma, cmd); 1280 err = security_sem_semctl(sma, cmd);
1281 if (err) { 1281 if (err) {
1282 rcu_read_unlock(); 1282 rcu_read_unlock();
1283 goto out_unlock; 1283 goto out_up;
1284 } 1284 }
1285 1285
1286 switch(cmd){ 1286 switch(cmd){