[PATCH] ipc/sem.c: scan complex wait-for-zero after undefined updates
From: Manfred Spraul
Date: Sat Jun 15 2013 - 10:06:58 EST
After an update of a semaphore array that does not use struct sembuf,
complex wait-for-zero operations were not checked if they are able to
proceed.
Andrew: Could you add it to -mm?
I've introduced the bug with
ipc-sem-separate-wait-for-zero-and-alter-tasks-into-seperate-queues.patch
Signed-off-by: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx>
---
ipc/sem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ipc/sem.c b/ipc/sem.c
index f9d1c06..ad9daca 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -785,8 +785,10 @@ static int do_smart_wakeup_zero(struct sem_array *sma, struct sembuf *sops,
* Assume all were changed.
*/
for (i = 0; i < sma->sem_nsems; i++) {
- if (sma->sem_base[i].semval == 0)
+ if (sma->sem_base[i].semval == 0) {
+ got_zero = 1;
semop_completed |= wake_const_ops(sma, i, pt);
+ }
}
}
/*
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/