android_kernel_google_msm/ipc
Linus Torvalds 3cda8eb001 Initialize msg/shm IPC objects before doing ipc_addid()
commit b9a532277938798b53178d5a66af6e2915cb27cf upstream.

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 e8577d1f03:
"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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2016-03-21 09:17:56 +08:00
..
compat.c [PATCH v3] ipc: provide generic compat versions of IPC syscalls 2012-03-15 13:13:38 -04:00
compat_mq.c
ipc_sysctl.c
ipcns_notifier.c
Makefile
mq_sysctl.c
mqueue.c switch open-coded instances of d_make_root() to new helper 2012-03-20 21:29:35 -04:00
msg.c Initialize msg/shm IPC objects before doing ipc_addid() 2016-03-21 09:17:56 +08:00
msgutil.c ipc, msg: fix message length check for negative values 2014-04-14 06:44:16 -07:00
namespace.c
sem.c ipc,sem: fix use after free on IPC_RMID after a task using same semaphore set exits 2016-03-21 09:17:52 +08:00
shm.c Initialize msg/shm IPC objects before doing ipc_addid() 2016-03-21 09:17:56 +08:00
syscall.c
util.c Initialize msg/shm IPC objects before doing ipc_addid() 2016-03-21 09:17:56 +08:00
util.h ipc, msg: fix message length check for negative values 2014-04-14 06:44:16 -07:00