Linux 3.10.41
Linux 3.10.42
futex: Add another early deadlock detection check

commit 866293ee54227584ffcb4a42f69c1f365974ba7f upstream.

Dave Jones trinity syscall fuzzer exposed an issue in the deadlock
detection code of rtmutex:
  http://lkml.kernel.org/r/20140429151655.GA14277@redhat.com

That underlying issue has been fixed with a patch to the rtmutex code,
but the futex code must not call into rtmutex in that case because
    - it can detect that issue early
    - it avoids a different and more complex fixup for backing out

If the user space variable got manipulated to 0x80000000 which means
no lock holder, but the waiters bit set and an active pi_state in the
kernel is found we can figure out the recursive locking issue by
looking at the pi_state owner. If that is the current task, then we
can safely return -EDEADLK.

The check should have been added in commit 59fa62451 (futex: Handle
futex_pi OWNER_DIED take over correctly) already, but I did not see
the above issue caused by user space manipulation back then.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Carlos ODonell <carlos@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: http://lkml.kernel.org/r/20140512201701.097349971@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Conflicts:
	kernel/futex.c
perf: remove duplicate call when removing per cpu events

* derp, adcd5a5 forgot to remove it - could be bad if left in there
Linux 3.10.43

* fixed up:

ARM: perf: hook up perf_sample_event_took around pmu irq handling
perf: Fix race in removing an event
Linux 3.10.44
Linux 3.10.45

* skipped:

nohz: Fix another inconsistency between CONFIG_NO_HZ=n and nohz=off
Linux 3.10.46

* fixed up:

USB: usb_wwan: fix potential blocked I/O after resume
USB: usb_wwan: fix potential NULL-deref at resume
USB: usb_wwan: fix urb leak at shutdown
USB: usb_wwan: fix write and suspend race
USB: usb_wwan: fix race between write and resume
Linux 3.10.47
Linux 3.10.48

* fixed up:

    usb: gadget: f_fs: fix NULL pointer dereference when there are no strings
Linux 3.10.49
Linux 3.10.50

* fixed up:

locking/mutex: Disable optimistic spinning on some architectures
Linux 3.10.51
Linux 3.10.52

* skipped:

        net/l2tp: don't fall back on UDP [get|set]sockopt
Linux 3.10.53
Linux 3.10.54
Linux 3.10.55
Linux 3.10.56

* fixed up:

usb: hub: take hub->hdev reference when processing from eventlist
usb: dwc3: core: fix order of PM runtime calls
usb: dwc3: core: fix ordering for PHY suspend
Linux 3.10.57

* skipped:

nl80211: clear skb cb before passing to netlink
cpufreq: Fix wrong time unit conversion
ondemand: Change the calculation of target frequency
Linux 3.10.58

* fixed up:

USB: Add device quirk for ASUS T100 Base Station keyboard