diff options
| author | Davidlohr Bueso <dave@stgolabs.net> | 2018-07-26 15:37:19 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-26 18:38:03 -0800 |
| commit | f075faa300acc4f6301e348acde0a4580ed5f77c (patch) | |
| tree | f2463b201b1785fd6af3cdd52bcf932267a85e92 /ipc | |
| parent | 15d36fecd0bdc7510b70a0e5ec6671140b3fce0c (diff) | |
| download | linux-stable-f075faa300acc4f6301e348acde0a4580ed5f77c.tar.gz linux-stable-f075faa300acc4f6301e348acde0a4580ed5f77c.tar.bz2 linux-stable-f075faa300acc4f6301e348acde0a4580ed5f77c.tar.xz linux-stable-f075faa300acc4f6301e348acde0a4580ed5f77c.zip | |
ipc/sem.c: prevent queue.status tearing in semop
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>
Diffstat (limited to 'ipc')
| -rw-r--r-- | ipc/sem.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -2118,7 +2118,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, | |||
| 2118 | } | 2118 | } |
| 2119 | 2119 | ||
| 2120 | do { | 2120 | do { |
| 2121 | queue.status = -EINTR; | 2121 | WRITE_ONCE(queue.status, -EINTR); |
| 2122 | queue.sleeper = current; | 2122 | queue.sleeper = current; |
| 2123 | 2123 | ||
| 2124 | __set_current_state(TASK_INTERRUPTIBLE); | 2124 | __set_current_state(TASK_INTERRUPTIBLE); |
