mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a7c2491a13
commit
6003a93e7b
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue