The patch titled Subject: ipc/sem.c: prevent queue.status tearing in semop has been added to the -mm tree. Its filename is ipc-sem-prevent-queuestatus-tearing-in-semop.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ipc-sem-prevent-queuestatus-tearing-in-semop.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ipc-sem-prevent-queuestatus-tearing-in-semop.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Davidlohr Bueso <dave@xxxxxxxxxxxx> Subject: 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@xxxxxxxxxxxx Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx> Cc: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN ipc/sem.c~ipc-sem-prevent-queuestatus-tearing-in-semop ipc/sem.c --- a/ipc/sem.c~ipc-sem-prevent-queuestatus-tearing-in-semop +++ a/ipc/sem.c @@ -2118,7 +2118,7 @@ static long do_semtimedop(int semid, str } do { - queue.status = -EINTR; + WRITE_ONCE(queue.status, -EINTR); queue.sleeper = current; __set_current_state(TASK_INTERRUPTIBLE); _ Patches currently in -mm which might be from dave@xxxxxxxxxxxx are ipc-sem-prevent-queuestatus-tearing-in-semop.patch ipc-drop-ipc_lock.patch lib-rhashtable-simplify-bucket_table_alloc.patch lib-rhashtable-guarantee-initial-hashtable-allocation.patch ipc-get-rid-of-ids-tables_initialized-hack.patch ipc-simplify-ipc-initialization.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html