futex: Add another early deadlock detection check
futex: Make lookup_pi_state more robust
lzo: properly check for overruns

commit 206a81c18401c0cde6e579164f752c4b147324ce upstream.
The lzo decompressor can, if given some really crazy data, possibly
overrun some variable types.  Modify the checking logic to properly
detect overruns before they happen.
net/l2tp: don't fall back on UDP [get|set]sockopt

The l2tp [get|set]sockopt() code has fallen back to the UDP functions
for socket option levels != SOL_PPPOL2TP since day one, but that has
never actually worked, since the l2tp socket isn't an inet socket.

As David Miller points out:

  "If we wanted this to work, it'd have to look up the tunnel and then
   use tunnel->sk, but I wonder how useful that would be"

Since this can never have worked so nobody could possibly have depended
on that functionality, just remove the broken code and return -EINVAL.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: James Chapman <jchapman@katalix.com>
Acked-by: David Miller <davem@davemloft.net>
Cc: Phil Turnbull <phil.turnbull@oracle.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change-Id: Iccb3384e7090e8c7cbcd717c12465c45d22c4393
Enable caching and buffering for all of physical RAM in the decompressor.

Old method is to enable caching and buffering only for the 256 MB at the
start of the decompressor image.  This makes a hardboot-kexec'd kernel very
slow to decompress since the decompressor is located far above the kernel
destination.  This patch reduces boot time from 35 to 8 seconds.

Change-Id: Ie37fd5092301bcf930652983a9cd8217e6312a74
Support copying of kernel tagged list (atags) in the decompressor.

This is needed to hardboot kexec a kernel with a new tags list (including a
new kernel command line), since the new atags would otherwise be lost with
the limited kernel memory mapping.  Without this patch, a hardboot-kexec'd
kernel uses the atags provided by the bootloader.

Change-Id: Ifafb9713952de7fb749a7bc64d20849649359a1f
Enable kexec syscall and fix support for ARMv7.

Essentially a backport of the relevant functions from Linux 3.1-rc4.  In
particular, it now actually disables the MMU in preparation for
soft boot.  Without this, relocate_new_kernel() would hang for an unknown
reason.  Although, it's known that there's no safe way to execute that
function with the MMU on as it may overwrite active page tables.

The suggestion to call cpu_reset by its physical address comes from an
earlier kexec support patch by Will Deacon [1].

[1] W. Deacon. [4/6] ARM: reset: add reset functionality for jumping to a
    physical address, Jun. 2011. https://patchwork.kernel.org/patch/852802/

Change-Id: Ib41728a1b4a5d02241266feed8e4bb75e35123c4
Support hard booting to a kexec kernel.

See KEXEC_HARDBOOT config option help for details.

Change-Id: If1a45732f1f10f28c44d179e0c7589968e146ac7