All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Backlund <tmb@mandriva.org>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add missing memory barriers to ipc/sem.c
Date: Sat, 24 Dec 2005 13:38:35 +0200	[thread overview]
Message-ID: <dojbve$5bq$1@sea.gmane.org> (raw)
In-Reply-To: <43AC80E5.6050906@colorfullife.com>

Manfred Spraul wrote:
> 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>
> 
> 
> ------------------------------------------------------------------------
> 
> --- 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();

Typo? Shouldn't it be smp_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;
>  	}


      reply	other threads:[~2005-12-24 11:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 22:57 [PATCH] add missing memory barriers to ipc/sem.c Manfred Spraul
2005-12-24 11:38 ` Thomas Backlund [this message]

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='dojbve$5bq$1@sea.gmane.org' \
    --to=tmb@mandriva.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.