kernel-ark/include
Eric Dumazet 60bc851ae5 af_unix: fix a fatal race with bit fields
Using bit fields is dangerous on ppc64/sparc64, as the compiler [1]
uses 64bit instructions to manipulate them.
If the 64bit word includes any atomic_t or spinlock_t, we can lose
critical concurrent changes.

This is happening in af_unix, where unix_sk(sk)->gc_candidate/
gc_maybe_cycle/lock share the same 64bit word.

This leads to fatal deadlock, as one/several cpus spin forever
on a spinlock that will never be available again.

A safer way would be to use a long to store flags.
This way we are sure compiler/arch wont do bad things.

As we own unix_gc_lock spinlock when clearing or setting bits,
we can use the non atomic __set_bit()/__clear_bit().

recursion_level can share the same 64bit location with the spinlock,
as it is set only with this spinlock held.

[1] bug fixed in gcc-4.8.0 :
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52080

Reported-by: Ambrose Feinstein <ambrose@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-01 15:13:49 -04:00
..
acpi Fixes: 2013-03-12 20:25:53 -07:00
asm-generic x86-32: Fix possible incomplete TLB invalidate with PAE pagetables 2013-04-12 16:56:47 -07:00
clocksource
crypto
drm drm/radeon: add Richland pci ids 2013-03-15 18:47:19 -04:00
keys
linux netpoll: convert mutex into a semaphore 2013-05-01 15:00:24 -04:00
math-emu
media
memory
misc
net af_unix: fix a fatal race with bit fields 2013-05-01 15:13:49 -04:00
pcmcia
ras
rdma
rxrpc
scsi libfc, fcoe, bnx2fc: Split fc_disc_init into fc_disc_{init, config} 2013-03-25 16:03:03 -07:00
sound Merge remote-tracking branch 'asoc/fix/max98090' into asoc-next 2013-03-26 14:08:03 +00:00
target
trace Revert "block: add missing block_bio_complete() tracepoint" 2013-04-18 09:00:26 -07:00
uapi net: Add MIB counters for checksum errors 2013-04-29 15:14:03 -04:00
video ARM: at91: fix LCD-wiring mode 2013-03-13 11:05:04 +01:00
xen xen-netback: coalesce slots in TX path and fix regressions 2013-04-22 15:37:01 -04:00
Kbuild