linux-stable/arch/arm/include/asm
Ard Biesheuvel 189af46571 ARM: smp: add support for per-task stack canaries
On ARM, we currently only change the value of the stack canary when
switching tasks if the kernel was built for UP. On SMP kernels, this
is impossible since the stack canary value is obtained via a global
symbol reference, which means
a) all running tasks on all CPUs must use the same value
b) we can only modify the value when no kernel stack frames are live
   on any CPU, which is effectively never.

So instead, use a GCC plugin to add a RTL pass that replaces each
reference to the address of the __stack_chk_guard symbol with an
expression that produces the address of the 'stack_canary' field
that is added to struct thread_info. This way, each task will use
its own randomized value.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Cc: Emese Revfy <re.emese@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Laura Abbott <labbott@redhat.com>
Cc: kernel-hardening@lists.openwall.com
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
2018-12-12 13:20:07 -08:00
..
hardware Merge branches 'fixes', 'misc', 'sa1111' and 'sa1100-for-next' into for-next 2018-01-21 15:38:10 +00:00
mach Merge branch 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-08-13 18:28:19 -07:00
xen License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch_gicv3.h irqchip/gic-v3: Probe for SCR_EL3 being clear before resetting AP0Rn 2018-03-22 13:46:18 +00:00
arch_timer.h arm64 updates for 4.15 2017-11-15 10:56:56 -08:00
arm-cci.h
asm-offsets.h
assembler.h Merge branches 'fixes', 'misc' and 'spectre' into for-next 2018-10-10 13:53:33 +01:00
atomic.h atomics/treewide: Clean up '*_andnot()' ifdeffery 2018-06-21 14:25:24 +02:00
auxvec.h
barrier.h ARM: spectre-v1: add array_index_mask_nospec() implementation 2018-05-31 23:27:21 +01:00
bitops.h ARM: 8785/1: use compiler built-ins for ffs and fls 2018-07-30 11:45:53 +01:00
bitrev.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bL_switcher.h
bug.h signal/arm: Push siginfo generation into arm_notify_die 2018-09-27 21:55:30 +02:00
bugs.h ARM: bugs: hook processor bug checking into SMP and suspend paths 2018-05-31 10:39:29 +01:00
cache.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cacheflush.h docs: Fix some broken references 2018-06-15 18:10:01 -03:00
cachetype.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
checksum.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
clocksource.h
cmpxchg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compiler.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cp15.h ARM: spectre-v2: harden user aborts in kernel space 2018-05-31 10:40:32 +01:00
cpu.h
cpufeature.h
cpuidle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cputype.h ARM: SoC platform updates 2018-06-11 17:49:09 -07:00
cti.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dcc.h
delay.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
device.h ARM: dma-mapping: Don't tear down third-party mappings 2017-05-30 11:31:33 +02:00
div64.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-contiguous.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-direct.h dma/direct: Handle the memory encryption bit in common code 2018-03-20 10:01:59 +01:00
dma-iommu.h kmemcheck: remove annotations 2017-11-15 18:21:04 -08:00
dma-mapping.h arm-nommu: don't define arch_teardown_dma_ops 2018-09-08 11:19:10 +02:00
dma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dmi.h efi/arm: Enable DMI/SMBIOS 2017-06-05 17:50:44 +02:00
domain.h
ecard.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
edac.h
efi.h efi: Deduplicate efi_open_volume() 2018-07-22 14:13:43 +02:00
elf.h Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-11-16 12:50:35 -08:00
entry-macro-multi.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
exception.h ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code 2017-12-17 22:14:21 +00:00
fb.h
fiq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
firmware.h
fixmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
flat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
floppy.h
fncpy.h
fpstate.h
ftrace.h ARM: 8788/1: ftrace: remove old mcount support 2018-09-19 10:44:50 +01:00
futex.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
glue-cache.h ARM: 8725/1: Add Broadcom Brahma-B15 readahead cache support 2017-12-17 22:15:35 +00:00
glue-df.h
glue-pf.h
glue-proc.h
glue.h
gpio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hardirq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
highmem.h Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-11-16 12:50:35 -08:00
hugetlb-3level.h hugetlb: introduce generic version of huge_ptep_get 2018-10-26 16:26:34 -07:00
hugetlb.h hugetlb: introduce generic version of huge_ptep_get 2018-10-26 16:26:34 -07:00
hw_breakpoint.h perf/hw_breakpoint: Remove default hw_breakpoint_arch_parse() 2018-06-26 09:07:58 +02:00
hw_irq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hwcap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hypervisor.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
insn.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io.h xen: don't include <xen/xen.h> from <asm/io.h> and <asm/dma-mapping.h> 2018-09-26 08:45:18 -06:00
irq.h ARM: Convert to GENERIC_IRQ_MULTI_HANDLER 2018-08-03 12:14:08 +02:00
irq_work.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irqflags.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jump_label.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kbuild time: Add an asm-generic/compat.h file 2018-04-19 13:28:51 +02:00
kexec.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kgdb.h ARM: 8764/1: kgdb: fix NUMREGBYTES so that gdb_regs[] is the correct size 2018-05-19 11:53:46 +01:00
kmap_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kprobes.h ARM/kprobes: Remove jprobe arm implementation 2018-06-21 12:33:07 +02:00
krait-l2-accessors.h ARM: Add Krait L2 register accessor functions 2018-10-17 13:14:33 -07:00
kvm_arm.h KVM updates for v4.20 2018-10-25 17:57:35 -07:00
kvm_asm.h Merge branches 'fixes', 'misc' and 'spectre' into for-linus 2018-06-05 10:03:27 +01:00
kvm_coproc.h KVM: arm: plug potential guest hardware debug leakage 2017-05-15 14:29:19 +02:00
kvm_emulate.h KVM/arm updates for 4.19 2018-08-22 14:07:56 +02:00
kvm_host.h arm/arm64: KVM: Rename function kvm_arch_dev_ioctl_check_extension() 2018-10-18 10:12:53 +01:00
kvm_hyp.h KVM: arm/arm64: Avoid VGICv3 save/restore on VHE with no IRQs 2018-03-19 10:53:21 +00:00
kvm_mmio.h
kvm_mmu.h KVM updates for v4.20 2018-10-25 17:57:35 -07:00
limits.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
linkage.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mc146818rtc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mcpm.h
mcs_spinlock.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memblock.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memory.h linux/const.h: move UL() macro to include/linux/const.h 2018-04-11 10:28:38 -07:00
mmu.h Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-11-16 12:50:35 -08:00
mmu_context.h
module.h ARM: module: fix modsign build error 2018-07-09 20:29:49 +02:00
mpu.h ARM: 8757/1: NOMMU: Support PMSAv8 MPU 2018-05-19 11:53:46 +01:00
mtd-xip.h
neon.h
nwflash.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
opcodes-sec.h
opcodes-virt.h
opcodes.h
outercache.h
page-nommu.h ARM: 8684/1: NOMMU: Remove unused KTHREAD_SIZE definition 2017-06-27 14:58:10 +01:00
page.h
paravirt.h x86/paravirt: Use a single ops structure 2018-09-03 16:50:35 +02:00
patch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci.h PCI: remove PCI_DMA_BUS_IS_PHYS 2018-05-07 07:15:41 +02:00
percpu.h
perf_event.h
pgalloc.h kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK 2017-11-15 18:21:04 -08:00
pgtable-2level-hwdef.h
pgtable-2level-types.h
pgtable-2level.h mm: make the __PAGETABLE_PxD_FOLDED defines non-empty 2018-11-02 08:31:52 +01:00
pgtable-3level-hwdef.h
pgtable-3level-types.h
pgtable-3level.h mm: introduce ARCH_HAS_PTE_SPECIAL 2018-06-07 17:34:35 -07:00
pgtable-hwdef.h
pgtable-nommu.h ARM: 8676/1: NOMMU: provide pgprot_device() macro 2017-06-05 10:29:40 +01:00
pgtable.h KVM: arm/arm64: Limit icache invalidation to prefetch aborts 2018-01-08 15:20:45 +01:00
probes.h ARM/kprobes: Remove jprobe arm implementation 2018-06-21 12:33:07 +02:00
proc-fns.h ARM: bugs: add support for per-processor bug checking 2018-05-31 10:39:34 +01:00
processor.h treewide: remove current_text_addr 2018-10-31 08:54:12 -07:00
procinfo.h
prom.h
psci.h
ptdump.h ARM: 8737/1: mm: dump: add checking for writable and executable 2018-01-21 15:32:20 +00:00
ptrace.h linux/compiler.h: Split into compiler.h and compiler_types.h 2017-10-24 13:17:32 +02:00
sections.h ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code 2017-12-17 22:14:21 +00:00
secure_cntvoff.h ARM: smp: Add initialization of CNTVOFF 2018-05-08 14:50:42 +02:00
set_memory.h treewide: move set_memory_* functions away from cacheflush.h 2017-05-08 17:15:13 -07:00
setup.h
shmparam.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
signal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp.h ARM: 8708/1: NOMMU: Rework MPU to be mostly done in C 2017-10-23 16:58:59 +01:00
smp_plat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp_scu.h ARM: SoC platform updates for 4.15 2017-11-16 14:05:12 -08:00
smp_twd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sparsemem.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spinlock.h Merge branch 'linus' into locking/core, to resolve conflicts 2017-11-07 10:32:44 +01:00
spinlock_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stackprotector.h ARM: smp: add support for per-task stack canaries 2018-12-12 13:20:07 -08:00
stacktrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stage2_pgtable.h kvm: arm/arm64: Prepare for VM specific stage2 translations 2018-10-01 13:50:30 +01:00
string.h ARM: 8745/1: get rid of __memzero() 2018-01-21 15:37:56 +00:00
suspend.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
swab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
switch_to.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sync_bitops.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
syscall.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
system_info.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
system_misc.h ARM: spectre-v2: harden user aborts in kernel space 2018-05-31 10:40:32 +01:00
tcm.h
therm.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
thread_info.h ARM: smp: add support for per-task stack canaries 2018-12-12 13:20:07 -08:00
thread_notify.h
timex.h
tlb.h arm/asm/tlb.h: Fix build error implicit func declaration 2018-07-25 12:09:09 +02:00
tlbflush.h
tls.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
topology.h sched/topology, arch/arm: Rebuild sched_domain hierarchy when CPU capacity changes 2018-09-10 11:05:48 +02:00
traps.h ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code 2017-12-17 22:14:21 +00:00
trusted_foundations.h
uaccess.h Merge branches 'fixes', 'misc' and 'spectre' into for-next 2018-10-10 13:53:33 +01:00
ucontext.h Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-11-16 12:50:35 -08:00
unaligned.h ARM: 8715/1: add a private asm/unaligned.h 2017-10-24 10:33:23 +01:00
unified.h ARM: 8723/2: always assume the "unified" syntax for assembly code 2017-12-17 22:14:21 +00:00
unistd.h y2038: Compile utimes()/futimesat() conditionally 2018-08-29 15:42:23 +02:00
unwind.h
uprobes.h
user.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v7m.h ARM: 8757/1: NOMMU: Support PMSAv8 MPU 2018-05-19 11:53:46 +01:00
vdso.h ARM: 8748/1: mm: Define vdso_start, vdso_end as array 2018-03-24 14:27:49 +00:00
vdso_datapage.h
vfp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfpmacros.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vga.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
virt.h
word-at-a-time.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xor.h