Commit f075faa3 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Linus Torvalds

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

Link: default avatarDavidlohr Bueso <>
Cc: Manfred Spraul <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 15d36fec
...@@ -2118,7 +2118,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, ...@@ -2118,7 +2118,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);
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