summaryrefslogtreecommitdiff
path: root/ipc/sem.c
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2005-12-24 01:57:41 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-24 23:13:27 +0300
commit6003a93e7bf6c02f33c02976ff364785d4273295 (patch)
treec81c159d6b04f9bffcf9984d5259eb0448683f7d /ipc/sem.c
parenta7c2491a13cc72fc09c062e635b9a77ff6bb4a73 (diff)
downloadlinux-6003a93e7bf6c02f33c02976ff364785d4273295.tar.xz
[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/sem.c')
-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)
/* hands-off: q will disappear immediately after
* writing q->status.
*/
+ smb_wmb();
q->status = error;
q = n;
} else {
@@ -461,6 +462,7 @@ static void freeary (struct sem_array *sma, int id)
n = q->next;
q->status = IN_WAKEUP;
wake_up_process(q->sleeper); /* doesn't sleep */
+ smp_wmb();
q->status = -EIDRM; /* hands-off q */
q = n;
}