android_kernel_samsung_msm8976/ipc
Manfred Spraul 30e5bc30f5 ipc/sem.c: update/correct memory barriers
commit 3ed1f8a99d70ea1cd1508910eb107d0edcae5009 upstream.

sem_lock() did not properly pair memory barriers:

!spin_is_locked() and spin_unlock_wait() are both only control barriers.
The code needs an acquire barrier, otherwise the cpu might perform read
operations before the lock test.

As no primitive exists inside <include/spinlock.h> and since it seems
noone wants another primitive, the code creates a local primitive within
ipc/sem.c.

With regards to -stable:

The change of sem_wait_array() is a bugfix, the change to sem_lock() is a
nop (just a preprocessor redefinition to improve the readability).  The
bugfix is necessary for all kernels that use sem_wait_array() (i.e.:
starting from 3.10).

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Reported-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Kirill Tkhai <ktkhai@parallels.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13 09:07:59 -07:00
..
Makefile
compat.c ipc: fix compat msgrcv with negative msgtyp 2015-04-19 10:10:50 +02:00
compat_mq.c
ipc_sysctl.c ipc: always handle a new value of auto_msgmni 2014-11-21 09:22:54 -08:00
ipcns_notifier.c
mq_sysctl.c ipc,mqueue: remove limits for the amount of system-wide queues 2014-03-06 21:30:12 -08:00
mqueue.c ipc: modify message queue accounting to not take kernel data structures into account 2015-08-16 20:51:40 -07:00
msg.c ipc: Fix 2 bugs in msgrcv() MSG_COPY implementation 2014-03-23 21:38:17 -07:00
msgutil.c ipc, msg: fix message length check for negative values 2013-12-04 10:56:10 -08:00
namespace.c ipc: drop ipc_lock_by_ptr 2013-10-18 07:45:48 -07:00
sem.c ipc/sem.c: update/correct memory barriers 2015-09-13 09:07:59 -07:00
shm.c ipc,shm: fix shm_file deletion races 2013-11-29 11:11:41 -08:00
syscall.c get rid of union semop in sys_semctl(2) arguments 2013-03-05 15:14:16 -05:00
util.c ipc: update locking scheme comments 2013-12-04 10:56:12 -08:00
util.h ipc, msg: fix message length check for negative values 2013-12-04 10:56:10 -08:00