https://github.com/torvalds/linux
Revision 3ed1f8a99d70ea1cd1508910eb107d0edcae5009 authored by Manfred Spraul on 14 August 2015, 22:35:10 UTC, committed by Linus Torvalds on 14 August 2015, 22:56:32 UTC
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> Cc: <stable@vger.kernel.org> [3.10+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7f6bf39
Tip revision: 3ed1f8a99d70ea1cd1508910eb107d0edcae5009 authored by Manfred Spraul on 14 August 2015, 22:35:10 UTC
ipc/sem.c: update/correct memory barriers
ipc/sem.c: update/correct memory barriers
Tip revision: 3ed1f8a
File | Mode | Size |
---|---|---|
aoa | ||
arm | ||
atmel | ||
core | ||
drivers | ||
firewire | ||
hda | ||
i2c | ||
isa | ||
mips | ||
oss | ||
parisc | ||
pci | ||
pcmcia | ||
ppc | ||
sh | ||
soc | ||
sparc | ||
spi | ||
synth | ||
usb | ||
Kconfig | -rw-r--r-- | 3.8 KB |
Makefile | -rw-r--r-- | 544 bytes |
ac97_bus.c | -rw-r--r-- | 1.6 KB |
last.c | -rw-r--r-- | 1.2 KB |
sound_core.c | -rw-r--r-- | 15.6 KB |
sound_firmware.c | -rw-r--r-- | 1.6 KB |
Computing file changes ...