android_kernel_samsung_msm8976/arch/x86/kernel
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
..
acpi x86, suspend: Handle CPUs which fail to #GP on RDMSR 2013-08-04 16:50:53 +08:00
apic x86, apic: Handle a bad TSC more gracefully 2014-11-14 08:48:00 -08:00
cpu x86, hyperv: Mark the Hyper-V clocksource as being continuous 2015-01-29 17:40:56 -08:00
kprobes ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing 2015-01-27 07:52:32 -08:00
.gitignore
alternative.c x86, cpu: Expand cpufeature facility to include cpu bugs 2013-04-02 10:12:52 -07:00
amd_gart_64.c x86, mm: use pfn_range_is_mapped() with gart 2012-11-17 11:59:10 -08:00
amd_nb.c x86, amd_nb: Clarify F15h, model 30h GART and L3 support 2013-09-26 17:18:14 -07:00
apb_timer.c Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 20:11:07 -08:00
aperture_64.c x86/mm/gart: Drop unnecessary check 2013-04-16 10:54:40 +02:00
apm_32.c cpuidle: remove en_core_tk_irqen flag 2013-04-23 13:45:22 +02:00
asm-offsets.c
asm-offsets_32.c x86, gdt, hibernate: Store/load GDT for hibernate path. 2013-05-02 11:27:35 -07:00
asm-offsets_64.c x86, gdt, hibernate: Store/load GDT for hibernate path. 2013-05-02 11:27:35 -07:00
audit_64.c
bootflag.c
check.c
cpuid.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
crash.c x86/kexec: crash_vmclear_local_vmcss needs __rcu 2012-12-11 19:55:23 -02:00
crash_dump_32.c
crash_dump_64.c
devicetree.c of: Specify initrd location using 64-bit 2014-02-07 13:49:42 -08:00
doublefault_32.c x86, xen, gdt: Remove the pvops variant of store_gdt. 2013-04-11 15:40:38 -07:00
dumpstack.c x86_64: add KASan support 2015-05-04 14:03:57 -07:00
dumpstack_32.c dump_stack: unify debug information printed by show_regs() 2013-04-30 17:04:02 -07:00
dumpstack_64.c x86_64, traps: Stop using IST for #SS 2014-12-06 15:05:46 -08:00
e820.c x86: avoid remapping data in parse_setup_data() 2013-10-18 07:45:48 -07:00
early-quirks.c x86: Adjust irq remapping quirk for older revisions of 5500/5520 chipsets 2014-04-26 17:15:34 -07:00
early_printk.c early_printk: consolidate random copies of identical code 2013-04-29 18:28:13 -07:00
entry_32.S x86, espfix: Make it possible to disable 16-bit support 2014-08-07 14:30:26 -07:00
entry_64.S x86/asm/entry/64: Remove a bogus 'ret_from_fork' optimization 2015-03-18 13:22:28 +01:00
espfix_64.c x86/espfix/xen: Fix allocation of pages for paravirt page tables 2014-08-07 14:30:27 -07:00
ftrace.c ftrace/x86: One more missing sync after fixup of function modification failure 2014-05-06 07:55:28 -07:00
head.c x86: Make sure we can boot in the case the BDA contains pure garbage 2013-02-27 13:38:57 -08:00
head32.c x86: Merge early kernel reserve for 32bit and 64bit 2013-01-29 19:32:58 -08:00
head64.c x86_64: add KASan support 2015-05-04 14:03:57 -07:00
head_32.S x86: fix compile error due to X86_TRAP_NMI use in asm files 2014-03-23 21:38:15 -07:00
head_64.S x86_64: add KASan support 2015-05-04 14:03:57 -07:00
hpet.c x86, hpet: Introduce x86_msi_ops.setup_hpet_msi 2013-01-28 10:48:30 +01:00
hw_breakpoint.c
i386_ksyms_32.c x86-32: Add support for 64bit get_user() 2013-02-07 15:07:28 -08:00
i387.c x86, fpu: Check tsk_used_math() in kernel_fpu_end() for eager FPU 2014-03-23 21:38:19 -07:00
i8237.c
i8253.c
i8259.c
io_delay.c
ioport.c x86: get rid of pt_regs argument of iopl(2) 2013-02-03 18:16:24 -05:00
irq.c Merge tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2013-05-05 14:47:31 -07:00
irq_32.c
irq_64.c
irq_work.c
irqinit.c KVM: VMX: Register a new IPI for posted interrupt 2013-04-16 16:32:39 -03:00
jump_label.c
kdebugfs.c
kgdb.c
kvm.c x86, kvm: Clear paravirt_enabled on KVM guests for espfix32's benefit 2015-01-08 09:58:15 -08:00
kvmclock.c x86, kvm: Clear paravirt_enabled on KVM guests for espfix32's benefit 2015-01-08 09:58:15 -08:00
ldt.c x86, espfix: Make it possible to disable 16-bit support 2014-08-07 14:30:26 -07:00
machine_kexec_32.c
machine_kexec_64.c x86, kexec, 64bit: Only set ident mapping for ram. 2013-01-29 15:26:35 -08:00
Makefile x86_64: add KASan support 2015-05-04 14:03:57 -07:00
microcode_amd.c x86/microcode/amd: Tone down printk(), don't treat a missing firmware file as an error 2013-11-29 11:11:49 -08:00
microcode_core.c x86/microcode_intel.h: Define functions and macros for early loading ucode 2013-01-31 13:18:50 -08:00
microcode_core_early.c x86, microcode: Verify the family before dispatching microcode patching 2013-04-19 16:36:03 -07:00
microcode_intel.c x86/microcode_intel.h: Define functions and macros for early loading ucode 2013-01-31 13:18:50 -08:00
microcode_intel_early.c x86/microcode: Add local mutex to fix physical CPU hot-add deadlock 2013-05-09 11:10:00 +02:00
microcode_intel_lib.c x86/microcode_intel_lib.c: Early update ucode on Intel's CPU 2013-01-31 13:19:14 -08:00
mmconf-fam10h_64.c
module.c kasan: enable instrumentation of global variables 2015-05-04 14:03:57 -07:00
mpparse.c
msr.c more file_inode() open-coded instances 2013-02-27 16:59:05 -05:00
nmi.c x86/nmi: export local_touch_nmi() symbol for modules 2013-01-17 22:25:57 +08:00
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 08:41:21 -07:00
paravirt_patch_32.c
paravirt_patch_64.c x86_64/entry/xen: Do not invoke espfix64 on Xen 2014-08-07 14:30:26 -07:00
pci-calgary_64.c
pci-dma.c x86: dma-mapping: fix GFP_ATOMIC macro usage 2014-03-06 21:30:08 -08:00
pci-iommu_table.c
pci-nommu.c
pci-swiotlb.c
pcspeaker.c
perf_regs.c
probe_roms.c
process.c Merge upstream linux-stable v3.10.28 into msm-3.10 2014-03-24 14:28:34 -07:00
process_32.c x86, flags: Rename X86_EFLAGS_BIT1 to X86_EFLAGS_FIXED 2014-11-14 08:47:54 -08:00
process_64.c x86_64, switch_to(): Load TLS descriptors before switching DS and ES 2015-01-08 09:58:15 -08:00
ptrace.c x86, x32, audit: Fix x32's AUDIT_ARCH wrt audit 2014-11-21 09:22:52 -08:00
pvclock.c x86/kvm: Fix pvclock vsyscall fixmap 2013-02-28 08:50:11 +02:00
quirks.c x86/amd/numa: Fix northbridge quirk to assign correct NUMA node 2014-03-23 21:38:15 -07:00
reboot.c Merge upstream linux-stable v3.10.28 into msm-3.10 2014-03-24 14:28:34 -07:00
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S x86: Fix typo in kexec register clearing 2013-06-12 15:16:18 -07:00
resource.c x86: don't exclude low BIOS area when allocating address space for non-PCI cards 2014-09-05 16:28:36 -07:00
rtc.c x86: Do full rtc synchronization with ntp 2013-03-15 16:50:26 -07:00
setup.c x86_64: add KASan support 2015-05-04 14:03:57 -07:00
setup_percpu.c
signal.c x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal() 2014-11-14 08:47:54 -08:00
smp.c
smpboot.c sched: Fix unreleased llc_shared_mask bit during CPU hotplug 2014-10-05 14:54:14 -07:00
stacktrace.c
step.c ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL 2013-01-22 10:08:00 -08:00
sys_x86_64.c x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member 2013-08-29 09:47:39 -07:00
syscall_32.c
syscall_64.c
tboot.c Revert "x86-64/efi: Use EFI to deal with platform wall clock (again)" 2012-12-15 15:20:41 -08:00
tce_64.c
test_nx.c
test_rodata.c
time.c
tls.c x86, tls: Interpret an all-zero struct user_desc as "no segment" 2015-01-29 17:40:56 -08:00
tls.h
topology.c x86, topology: Debug CPU0 hotplug 2012-11-14 15:28:11 -08:00
trace_clock.c tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
traps.c x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs 2015-01-29 17:40:56 -08:00
tsc.c x86/tsc: Change Fast TSC calibration failed from error to info 2015-01-29 17:40:56 -08:00
tsc_sync.c
uprobes.c uretprobes/x86: Hijack return address 2013-04-13 15:31:55 +02:00
verify_cpu.S
vm86_32.c x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) 2013-05-02 20:36:32 -04:00
vmlinux.lds.S x86: Drop always empty .text..page_aligned section 2013-03-11 15:07:56 +01:00
vsmp_64.c
vsyscall_64.c x86_64/vsyscall: Fix warn_bad_vsyscall log output 2014-09-05 16:28:36 -07:00
vsyscall_emu_64.S
vsyscall_trace.h
x86_init.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-21 18:06:55 -08:00
x8664_ksyms_64.c x86_64: kasan: add interceptors for memset/memmove/memcpy functions 2015-05-04 14:03:56 -07:00
xsave.c x86/fpu: Avoid math_state_restore() without used_math() in __restore_xstate_sig() 2015-03-26 15:01:00 +01:00