Commit 355e371a authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Tim Gardner

UBUNTU: SAUCE: suspicious unlocked ->status reading and writing in ipc/sem.c

Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent b15b441d
...@@ -1983,6 +1983,14 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, ...@@ -1983,6 +1983,14 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
*/ */
error = get_queue_result(&queue); error = get_queue_result(&queue);
/*
* wake_up_sem_queue_do operates on queue without locking, so we
* need a barrier here to order our read of queue.status and the
* subsequent reuse of queue (queue is on the stack so will be
* most likely reused in the next function call).
*/
smp_mb();
/* /*
* Array removed? If yes, leave without sem_unlock(). * Array removed? If yes, leave without sem_unlock().
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment