ipc/sem.c: prevent queue.status tearing in semop
authorDavidlohr Bueso <dave@stgolabs.net>
Thu, 26 Jul 2018 23:37:19 +0000 (16:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:26:30 +0000 (09:26 +0200)
commit92c159863d8afefa9ca25a180feba6bff11c2be5
treeaab75a7b3c41841918189e1c70d4ff0efb62eecb
parent2dd2f772257054867543c8051a174b3e1d879c2f
ipc/sem.c: prevent queue.status tearing in semop

[ Upstream commit f075faa300acc4f6301e348acde0a4580ed5f77c ]

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>
ipc/sem.c