]> git.baikalelectronics.ru Git - kernel.git/commit
Initialize msg/shm IPC objects before doing ipc_addid()
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Sep 2015 16:48:40 +0000 (12:48 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Sep 2015 16:48:40 +0000 (12:48 -0400)
commit51b2573e746c45181e9068044cb24cd204e1a5af
tree61938755aa03a1fcde29b3fcea8b29ef962af58f
parent11844ff26f69f7448aa91f3b7deb6c1e2ae547ae
Initialize msg/shm IPC objects before doing ipc_addid()

As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before
having initialized the IPC object state.  Yes, we initialize the IPC
object in a locked state, but with all the lockless RCU lookup work,
that IPC object lock no longer means that the state cannot be seen.

We already did this for the IPC semaphore code (see commit 72011b2fd64f:
"ipc/sem.c: fully initialize sem_array before making it visible") but we
clearly forgot about msg and shm.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/msg.c
ipc/shm.c
ipc/util.c