android_kernel_google_msm/mm
Jeff Vander Stoep 51f2ffdb80 mm: reorder can_do_mlock to fix audit denial
A userspace call to mmap(MAP_LOCKED) may result in the successful locking
of memory while also producing a confusing audit log denial.  can_do_mlock
checks capable and rlimit.  If either of these return positive
can_do_mlock returns true.  The capable check leads to an LSM hook used by
apparmour and selinux which produce the audit denial.  Reordering so
rlimit is checked first eliminates the denial on success, only recording a
denial when the lock is unsuccessful as a result of the denial.

(cherry picked from e48e8c45925185c02b23ae461671be29c91101d5)

Bug: 19590990
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Acked-by: Nick Kralevich <nnk@google.com>
Cc: Jeff Vander Stoep <jeffv@google.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Paul Cassella <cassella@cray.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2015-06-16 23:08:46 -07:00
..
backing-dev.c
bootmem.c
bounce.c
cleancache.c
compaction.c cma: fix watermark checking 2013-03-15 17:06:38 -07:00
debug-pagealloc.c
dmapool.c
fadvise.c
failslab.c
filemap.c
filemap_xip.c
fremap.c
highmem.c
huge_memory.c
hugetlb.c
hwpoison-inject.c
init-mm.c
internal.h cma: fix watermark checking 2013-03-15 17:06:38 -07:00
Kconfig
Kconfig.debug
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c
maccess.c
madvise.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
Makefile
memblock.c
memcontrol.c
memory-failure.c
memory.c mm: Use correct define for CMA features 2013-03-07 15:23:58 -08:00
memory_hotplug.c
mempolicy.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
mempool.c
migrate.c
mincore.c
mlock.c mm: reorder can_do_mlock to fix audit denial 2015-06-16 23:08:46 -07:00
mm_init.c
mmap.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
mremap.c
msync.c
nobootmem.c
nommu.c
oom_kill.c mm, oom: make dump_tasks public 2014-11-18 15:13:25 -08:00
page-writeback.c
page_alloc.c mm: workaround for widevine playback failed 2013-05-22 07:57:36 +00:00
page_cgroup.c
page_io.c
page_isolation.c
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
prio_tree.c
process_vm_access.c
quicklist.c
readahead.c
rmap.c
shmem.c
slab.c
slob.c
slub.c slub: fix a memory leak in get_partial_node() 2013-03-15 17:09:26 -07:00
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c
swapfile.c
thrash.c
truncate.c
util.c nick kvfree() from apparmor 2014-11-18 15:13:23 -08:00
vmalloc.c
vmscan.c
vmstat.c mm: make counts of CMA free pages correct 2013-03-07 15:23:58 -08:00