linux/include
Konstantin Khlebnikov 936c791525 mm: replace vma_lock_anon_vma with anon_vma_lock_read/write
[ Upstream commit 12352d3cae ]

Sequence vma_lock_anon_vma() - vma_unlock_anon_vma() isn't safe if
anon_vma appeared between lock and unlock.  We have to check anon_vma
first or call anon_vma_prepare() to be sure that it's here.  There are
only few users of these legacy helpers.  Let's get rid of them.

This patch fixes anon_vma lock imbalance in validate_mm().  Write lock
isn't required here, read lock is enough.

And reorders expand_downwards/expand_upwards: security_mmap_addr() and
wrapping-around check don't have to be under anon vma lock.

Link: https://lkml.kernel.org/r/CACT4Y+Y908EjM2z=706dv4rV6dWtxTLK9nFg9_7DhRMLppBo2g@mail.gmail.com
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2016-02-15 15:42:41 -05:00
..
acpi ACPICA: Tables: Fix an issue that FACS initialization is performed twice 2015-08-04 14:33:56 -04:00
asm-generic mmu_gather: move minimal range calculations into generic code 2015-03-28 09:22:01 -04:00
clocksource ARM: pxa: Add non device-tree timer link to clocksource 2014-07-23 12:02:39 +02:00
crypto crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path 2016-02-09 22:57:33 -05:00
drm drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil 2016-02-15 15:42:41 -05:00
dt-bindings The fixes for the clock framework are all regressions in drivers, plus a 2014-11-25 17:52:56 -08:00
keys KEYS: Restore partial ID matching functionality for asymmetric keys 2014-10-06 15:21:05 +01:00
kvm arm/arm64: KVM: Keep elrsr/aisr in sync with software model 2015-05-11 07:07:37 -04:00
linux mm: replace vma_lock_anon_vma with anon_vma_lock_read/write 2016-02-15 15:42:41 -05:00
math-emu math-emu: fix floating-point to integer overflow detection 2014-01-07 18:36:24 -06:00
media Merge branch 'patchwork' into v4l_for_linus 2014-10-09 14:00:54 -03:00
memory ddr: add LPDDR2 data from JESD209-2 2012-05-02 00:04:06 -07:00
misc cxl: Add new header for call backs and structs 2014-10-08 20:15:43 +11:00
net mac802154: fix typo IEEE802515 to IEEE802154 2016-02-09 22:57:31 -05:00
pcmcia pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate 2013-03-15 12:26:03 -07:00
ras PCI/AER: Rename PCI_ERR_UNC_TRAIN to PCI_ERR_UNC_UND 2014-09-25 09:42:40 -06:00
rdma IB/mlx5, iser, isert: Add Signature API additions 2014-10-09 00:10:53 -07:00
rxrpc include/rxrpc/types.h: Remove unused header 2014-08-29 20:33:39 -07:00
scsi SCSI: add 1024 max sectors black list flag 2015-08-06 14:49:50 -04:00
soc/tegra ARM: tegra: Convert PMC to a driver 2014-07-17 14:58:43 +02:00
sound ALSA: rawmidi: Make snd_rawmidi_transmit() race-free 2016-02-15 15:42:38 -05:00
target target/iscsi: Fix np_ip bracket issue by removing np_ip 2015-10-27 22:12:52 -04:00
trace regmap: introduce regmap_name to fix syscon regmap trace events 2015-04-16 20:11:29 -04:00
uapi if_link: Add an additional parameter to ifla_vf_info for RSS querying 2015-10-27 09:31:42 -04:00
video fbdev changes for 3.18 2014-10-18 18:03:02 -07:00
xen x86/xen: Support kexec/kdump in HVM guests by doing a soft reset 2015-10-27 22:13:13 -04:00
Kbuild UAPI: remove empty Kbuild files 2013-04-30 17:04:09 -07:00