aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2005-12-23 17:57:41 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-24 15:13:27 -0500
commit6003a93e7bf6c02f33c02976ff364785d4273295 (patch)
treec81c159d6b04f9bffcf9984d5259eb0448683f7d /ipc
parenta7c2491a13cc72fc09c062e635b9a77ff6bb4a73 (diff)
[PATCH] add missing memory barriers to ipc/sem.c
Two smp_wmb() statements are missing in the sysv sem code: This could cause stack corruptions. The attached patch adds them. Signed-Off-By: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/sem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 19af028a3e38..6a16f8edf2b2 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -381,6 +381,7 @@ static void update_queue (struct sem_array * sma)
381 /* hands-off: q will disappear immediately after 381 /* hands-off: q will disappear immediately after
382 * writing q->status. 382 * writing q->status.
383 */ 383 */
384 smb_wmb();
384 q->status = error; 385 q->status = error;
385 q = n; 386 q = n;
386 } else { 387 } else {
@@ -461,6 +462,7 @@ static void freeary (struct sem_array *sma, int id)
461 n = q->next; 462 n = q->next;
462 q->status = IN_WAKEUP; 463 q->status = IN_WAKEUP;
463 wake_up_process(q->sleeper); /* doesn't sleep */ 464 wake_up_process(q->sleeper); /* doesn't sleep */
465 smp_wmb();
464 q->status = -EIDRM; /* hands-off q */ 466 q->status = -EIDRM; /* hands-off q */
465 q = n; 467 q = n;
466 } 468 }