From: Manfred Spraul <manfred@colorfullife.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>, Jack Steiner <steiner@sgi.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] add missing memory barriers to ipc/sem.c
Date: Fri, 23 Dec 2005 23:57:41 +0100 [thread overview]
Message-ID: <43AC80E5.6050906@colorfullife.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
Hi Linus,
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>
[-- Attachment #2: patch-ipc-sem-wmb --]
[-- Type: text/plain, Size: 465 bytes --]
--- 2.6/ipc/sem.c 2005-12-19 01:36:54.000000000 +0100
+++ build-2.6/ipc/sem.c 2005-12-23 23:25:17.000000000 +0100
@@ -381,6 +381,7 @@
/* hands-off: q will disappear immediately after
* writing q->status.
*/
+ smb_wmb();
q->status = error;
q = n;
} else {
@@ -461,6 +462,7 @@
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;
}
next reply other threads:[~2005-12-23 22:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-23 22:57 Manfred Spraul [this message]
2005-12-24 11:38 ` [PATCH] add missing memory barriers to ipc/sem.c Thomas Backlund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43AC80E5.6050906@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=steiner@sgi.com \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox