sock_diag: Fix out-of-bounds access to sock_diag_handlers[]

Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
with a family greater or equal then AF_MAX -- the array size of
sock_diag_handlers[]. The current code does not test for this
condition therefore is vulnerable to an out-of-bound access opening
doors for a privilege escalation.

Signed-off-by: Mathias Krause <minipli <at> googlemail.com>
mm/fs: route MADV_REMOVE to FALLOC_FL_PUNCH_HOLE

Now tmpfs supports hole-punching via fallocate(), switch madvise_remove()
to use do_fallocate() instead of vmtruncate_range(): which extends
madvise(,,MADV_REMOVE) support from tmpfs to ext4, ocfs2 and xfs.

There is one more user of vmtruncate_range() in our tree,
staging/android's ashmem_shrink(): convert it to use do_fallocate() too
(but if its unpinned areas are already unmapped - I don't know - then it
would do better to use shmem_truncate_range() directly).

Based-on-patch-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Colin Cross <ccross@android.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger@dilger.ca>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Ben Myers <bpm@sgi.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm: Hold a file reference in madvise_remove

Otherwise the code races with munmap (causing a use-after-free
of the vma) or with close (causing a use-after-free of the struct
file).

The bug was introduced by commit 90ed52ebe481 ("[PATCH] holepunch: fix
mmap_sem i_mutex deadlock")

Cc: Hugh Dickins <hugh@veritas.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Import of HUAWEI Y300_J1 source code

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
Import of HUAWEI Y300 J1

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
gitignore: re-sort it

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: Import of B199 kernel config

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: disable IOMMU support

* not supported on MSM7x27a targets

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: disable OABI_COMPAT (for SMP targets)

* This option not recommended for SMP targets

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: disable CONFIG_MODVERSIONS

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: bluetooth related updates

	* disable HCIUART_LL (only needed for BCM BT chipsets)
	* enable BT_BNEP features

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: disable CFG80211 & NL80211

* not required for Huawei's ATH6KL kernel module
  (going to use an external pre-compiled modules instead)

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: misc cleanups

	* disable some debugging
	* don't build test modules
	* disable MMC performance profiling
	* disable support for GT968 touchscreen

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: enable deadline I/O sched and make it default

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: enable westwood congestion avoidance algorithm

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: enable SWAP and KSM support

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: enable BPF JIT support

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
config: merge MSM7627a defconfig

	* disable SURF_FFA_GPIO_KEYPAD
	* disable BT_MSM_BLUESLEEP (supported on BCM BT chipsets only)
	* disable GPIO_SLEEP
	* disable REGULATOR_GPIO

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
ARM: Fix build warning in arch/arm/mm/alignment.c

Fix this harmless build warning:

arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:749:21: warning: 'offset.un' may be used uninitialized in this function

This is caused by the compiler not being able to properly analyse the
code to prove that offset.un is assigned in every case.  The case it
struggles with is where we assign the handler from the Thumb parser -
do_alignment_t32_to_handler().  As this starts by zeroing this variable
via a pointer, move it into the calling function.  This fixes the
warning.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: Fix another build warning in arch/arm/mm/alignment.c

One such warning was recently fixed in a761cebf "ARM: Fix build warning
in arch/arm/mm/alignment.c" but only for the thumb2 case, this fixes
the other half.

arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:327:15: error: 'offset.un' may be used uninitialized in this function
arch/arm/mm/alignment.c:748:21: note: 'offset.un' was declared here

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>