ipc/sem.c: prevent queue.status tearing in semop
[ Upstream commit f075faa300
]
In order for load/store tearing prevention to work, _all_ accesses to
the variable in question need to be done around READ and WRITE_ONCE()
macros. Ensure everyone does so for q->status variable for
semtimedop().
Link: http://lkml.kernel.org/r/20180717052654.676-1-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
parent
2dd2f77225
commit
92c159863d
|
@ -2041,7 +2041,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
queue.status = -EINTR;
|
WRITE_ONCE(queue.status, -EINTR);
|
||||||
queue.sleeper = current;
|
queue.sleeper = current;
|
||||||
|
|
||||||
__set_current_state(TASK_INTERRUPTIBLE);
|
__set_current_state(TASK_INTERRUPTIBLE);
|
||||||
|
|
Loading…
Reference in New Issue