lkml.org 
[lkml]   [2005]   [Dec]   [24]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromThomas Backlund <>
SubjectRe: [PATCH] add missing memory barriers to ipc/sem.c
DateSat, 24 Dec 2005 13:38:35 +0200
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;
>  	}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-24 12:43    [from the cache]
©2003-2008