android_kernel_samsung_msm8976/mm
Andrey Ryabinin a37ad26828 kasan: enable instrumentation of global variables
This feature let us to detect accesses out of bounds of global variables.
This will work as for globals in kernel image, so for globals in modules.
Currently this won't work for symbols in user-specified sections (e.g.
__init, __read_mostly, ...)

The idea of this is simple.  Compiler increases each global variable by
redzone size and add constructors invoking __asan_register_globals()
function.  Information about global variable (address, size, size with
redzone ...) passed to __asan_register_globals() so we could poison
variable's redzone.

This patch also forces module_alloc() to return 8*PAGE_SIZE aligned
address making shadow memory handling (
kasan_module_alloc()/kasan_module_free() ) more simple.  Such alignment
guarantees that each shadow page backing modules address space correspond
to only one module_alloc() allocation.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Konstantin Serebryany <kcc@google.com>
Cc: Dmitry Chernenkov <dmitryc@google.com>
Signed-off-by: Andrey Konovalov <adech.fo@gmail.com>
Cc: Yuri Gribov <tetra2005@gmail.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[dkeitel@codeaurora.org: resolve trivial merge conflicts]
Git-commit: bebf56a1b176c2e1c9efe44e7e6915532cc682cf
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Change-Id: I4dda6aa06fc53fd018a87ce8b08b62a9712f54fe
2015-05-04 14:03:57 -07:00
..
kasan kasan: enable instrumentation of global variables 2015-05-04 14:03:57 -07:00
Kconfig mm: Support address range reclaim 2015-04-16 10:15:20 -07:00
Kconfig.debug defconfig: 8994: enable CONFIG_DEBUG_SLUB_PANIC_ON 2014-10-21 14:00:18 -07:00
Makefile mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
backing-dev.c arch: Mass conversion of smp_mb__*() 2014-08-15 11:45:28 -07:00
balloon_compaction.c
bootmem.c mm: concentrate modification of totalram_pages into the mm core 2014-02-07 13:49:40 -08:00
bounce.c
cleancache.c
compaction.c mm: page_alloc: add kasan hooks on alloc and free paths 2015-05-04 14:03:54 -07:00
debug-pagealloc.c mm: Mark free pages as read only 2014-04-18 14:51:25 -07:00
dmapool.c
early_ioremap.c mm: create generic early_ioremap() support 2014-08-15 11:45:23 -07:00
fadvise.c
failslab.c
filemap.c mm: memcg: handle non-error OOM situations more gracefully 2014-11-21 09:22:56 -08:00
filemap_xip.c
fremap.c mm: fix use-after-free in sys_remap_file_pages 2014-01-09 12:24:24 -08:00
frontswap.c mm: frontswap: invalidate expired data on a dup-store failure 2014-12-16 09:09:41 -08:00
highmem.c
huge_memory.c mm: numa: Do not mark PTEs pte_numa when splitting huge pages 2014-10-09 12:18:42 -07:00
hugetlb.c mm/hugetlb: add migration entry check in __unmap_hugepage_range 2015-03-18 13:22:27 +01:00
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
interval_tree.c
kmemcheck.c
kmemleak-test.c
kmemleak.c kmemleak: disable kasan instrumentation for kmemleak 2015-05-04 14:03:56 -07:00
ksm.c mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
maccess.c
madvise.c mm: add a field to store names for private anonymous memory 2014-06-13 12:05:14 -07:00
memblock.c mm/memblock: add memblock_get_current_limit 2014-04-08 09:51:10 -07:00
memcontrol.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
memory-failure.c mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
memory.c This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
memory_hotplug.c
mempolicy.c Merge upstream tag 'v3.10.49' into msm-3.10 2014-08-20 13:23:09 -07:00
mempool.c
memtest.c memtest: use phys_addr_t for physical addresses 2015-04-01 09:27:43 -07:00
migrate.c mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
mincore.c
mlock.c Merge upstream tag 'v3.10.40' into msm-3.10 2014-06-18 13:10:54 -07:00
mm_init.c
mmap.c This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c mm: add a field to store names for private anonymous memory 2014-06-13 12:05:14 -07:00
mremap.c mm, thp: close race between mremap() and split_huge_page() 2014-06-07 13:25:31 -07:00
msync.c
nobootmem.c mm/nobootmem.c: Drop __init annotation from free_bootmem_late 2014-04-21 15:28:38 -07:00
nommu.c This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
oom_kill.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
page-writeback.c mm: page-writeback: fix page state calculation in throttle_vm_writeout 2015-03-26 13:50:54 +05:30
page_alloc.c mm: page_alloc: add kasan hooks on alloc and free paths 2015-05-04 14:03:54 -07:00
page_cgroup.c cgroup/kmemleak: add kmemleak_free() for cgroup deallocations. 2014-11-14 08:47:59 -08:00
page_io.c
page_isolation.c mm/page_alloc: Call kernel_map_pages in unset_migrateype_isolate 2015-03-19 11:34:36 -07:00
pageowner.c debugging: keep track of page owners 2014-03-28 13:33:08 -07:00
pagewalk.c mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range 2015-02-11 14:48:16 +08:00
percpu-km.c
percpu-vm.c percpu: perform tlb flush after pcpu_map_pages() failure 2014-10-05 14:54:13 -07:00
percpu.c Revert "percpu: free percpu allocation info for uniprocessor system" 2014-11-14 08:47:53 -08:00
pgtable-generic.c mm: fix TLB flush race between migration, and change_protection_range 2014-01-09 12:24:23 -08:00
process_reclaim.c mm: process reclaim: vmpressure based process reclaim 2015-04-16 11:00:47 -07:00
process_vm_access.c
quicklist.c
readahead.c
rmap.c mm: Enhance per process reclaim to consider shared pages 2015-04-16 10:14:27 -07:00
shmem.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
showmem.c mm: Add notifier framework for showing memory 2014-10-06 09:47:49 -07:00
slab.c mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
slab.h
slab_common.c mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
slob.c
slub.c mm: slub: add kernel address sanitizer support for slub allocator 2015-05-04 14:03:56 -07:00
sparse-vmemmap.c
sparse.c
swap.c mm: close PageTail race 2014-04-03 12:01:05 -07:00
swap_state.c Merge "lowmemorykiller: Don't count swap cache pages twice" 2015-04-09 06:38:02 -07:00
swapfile.c mm: swap: don't delay swap free for fast swap devices 2015-02-27 14:51:32 +05:30
truncate.c mm: Remove false WARN_ON from pagecache_isize_extended() 2014-11-14 08:48:00 -08:00
util.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
vmalloc.c mm: kmemleak: avoid false negatives on vmalloc'ed objects 2015-03-11 16:12:48 +05:30
vmpressure.c mm: vmpressure: scale pressure based on reclaim context 2015-04-08 22:33:46 +05:30
vmscan.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
vmstat.c mm: vmstat: make vmstat_work cpu bound during requeue 2015-04-27 09:45:51 +05:30
zbud.c
zswap.c mm, zswap: Fix CPU hotplug callback registration 2014-07-03 09:55:28 -07:00