Skip to content
Browse files

ipc/sem.c: prevent queue.status tearing in semop

[ Upstream commit f075faa ]

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

Signed-off-by: Davidlohr Bueso <>
Cc: Manfred Spraul <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Sasha Levin <>
Signed-off-by: Greg Kroah-Hartman <>
  • Loading branch information...
Davidlohr Bueso authored and gregkh committed Jul 26, 2018
1 parent 2dd2f77 commit 92c159863d8afefa9ca25a180feba6bff11c2be5
Showing with 1 addition and 1 deletion.
  1. +1 −1 ipc/sem.c
@@ -2041,7 +2041,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,

do {
queue.status = -EINTR;
WRITE_ONCE(queue.status, -EINTR);
queue.sleeper = current;


0 comments on commit 92c1598

Please sign in to comment.
You can’t perform that action at this time.