opnsense-src/sys/arm/arm
Mark Johnston 1be56e0bb1 arm/unwind: Check stack pointer boundaries before dereferencing
If the unwinder somehow ends up with a stack pointer that lies outside
the stack, then an attempt to dereference can lead to a fault, which
causes the kernel to panic again and unwind the stack, which leads to a
fault...

Add kstack_contains() checks at points where we dereference the stack
pointer.  This avoids the aforementioned infinite loop in one case I hit
where some OpenSSL assembly code apparently confuses the unwinder.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D41210
2023-07-27 15:44:00 -04:00
..
autoconf.c
bcopy_page.S
bcopyinout.S arm: Garbage collect _arm_memcpy/_arm_bzero. 2021-06-30 14:53:57 +02:00
bcopyinout_xscale.S arm: Garbage collect _arm_memcpy/_arm_bzero. 2021-06-30 14:53:57 +02:00
blockio.S
bus_space_asm_generic.S
bus_space_base.c
bus_space_generic.c pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t. 2022-09-22 15:08:52 -07:00
busdma_machdep.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
copystr.S
cpu_asm-v6.S
cpufunc.c get_cachetype_cp15: eliminate write only multilier 2022-04-04 22:29:06 -06:00
cpufunc_asm.S arm: Only include sysreg.h when needed in asm.h 2023-07-24 17:58:16 +01:00
cpufunc_asm_arm11x6.S
cpufunc_asm_armv7.S
cpufunc_asm_pj4b.S
cpuinfo.c arm: export actlr as sysctl hw.cpu.quirks.actlr_value 2021-08-24 14:21:39 +00:00
db_disasm.c
db_interface.c arm: Use C89 function declaration for db_read_bytes. 2023-04-20 11:00:46 -07:00
db_trace.c
debug_monitor.c arm dbg: Use PCPU_GET(cpuid) directly in assertions. 2022-04-13 16:08:21 -07:00
disassem.c
dump_machdep.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
elf_machdep.c sysentvec: Retire sv_imgact_try as unneeded anymore 2023-05-29 11:18:11 +03:00
elf_note.S
exception.S AST: rework 2022-08-02 21:11:09 +03:00
exec_machdep.c arm: Unbreak debugging programs that use FP instructions 2023-02-23 17:50:26 +01:00
fiq.c
fiq_subr.S
fusu.S Try to fix syntax of "strht" instruction so that clang is happy. 2021-12-19 13:52:36 +01:00
gdb_machdep.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
genassym.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
generic_timer.c Stop using the rid as an index in the arm timer 2023-03-15 15:49:00 +00:00
gic.c arm: remove passing trapframe to intr_ipi_dispatch() 2023-04-26 20:08:30 +01:00
gic.h Teach the GICv3 driver to translate memory ranges 2022-09-23 15:28:45 +01:00
gic_acpi.c arm/arm: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
gic_common.h Teach the GICv3 driver to translate memory ranges 2022-09-23 15:28:45 +01:00
gic_fdt.c ofw: add BUS_GET_DEVICE_PATH interface to openfirm/fdt, somewhat incomplete. 2022-10-18 16:55:47 +09:00
gic_if.m ddb: Add 'show gic <name>' and 'show all gics' commands. 2022-03-10 15:39:37 -08:00
hypervisor-stub.S arm: Only include sysreg.h when needed in asm.h 2023-07-24 17:58:16 +01:00
identcpu-v6.c Allow sysctl hw.machine/hw.machine_arch in capability mode 2023-02-06 14:00:52 -05:00
in_cksum_arm.S
in_cksum_machdep.c netinet: Deduplicate most in_cksum() implementations 2021-11-24 13:31:16 -05:00
locore-v6.S arm: Rename pte-v6.h to pte.h 2023-07-24 17:58:15 +01:00
locore.S
machdep.c arm: Fix initialization of VFP context 2023-02-23 17:50:26 +01:00
machdep_boot.c arm_add_efi_map_entries: Remove unused variable. 2022-04-08 17:30:14 -07:00
machdep_intr.c arm: remove passing trapframe to intr_ipi_dispatch() 2023-04-26 20:08:30 +01:00
machdep_kdb.c arm: Add support for using VFP in kernel 2023-02-04 20:21:43 +01:00
machdep_ptrace.c
mem.c
minidump_machdep.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
mp_machdep.c smp: Dynamically allocate the stoppcbs array 2023-05-25 18:09:55 -04:00
mpcore_timer.c arm/arm: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
mpcore_timervar.h
nexus.c nexus: Consistently return a pointer in failure paths 2023-05-26 15:38:08 -04:00
nexusvar.h
ofw_machdep.c
pl310.c arm/arm: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
platform.c
platform_if.m
platform_pl310_if.m
pmap-v6.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pmu.c
pmu.h arm/pmu: add ACPI attachment. 2021-11-02 19:35:29 +00:00
pmu_acpi.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pmu_fdt.c Store mpidr as a 64-bit value on arm64 2022-08-31 11:48:31 +01:00
ptrace_machdep.c Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.h 2023-02-02 00:59:26 +02:00
sc_machdep.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
setcpsr.S
setstack.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
sp804.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
stack_machdep.c
stdatomic.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
support.S arm: retire bzero 2021-08-23 15:23:42 +02:00
swtch-v6.S When saving a context on arm call the vfp handler 2023-02-20 12:29:56 +00:00
swtch.S When saving a context on arm call the vfp handler 2023-02-20 12:29:56 +00:00
sys_machdep.c sysarch: Add includes required for ktrcapfail() calls to be compiled 2023-06-01 17:18:23 -04:00
syscall.c syscallarg_t: Add a type for system call arguments 2022-03-28 19:43:03 +01:00
trap-v6.c proc: load/store p_cowgen using atomic primitives 2022-02-13 13:07:08 +00:00
uio_machdep.c
undefined.c arm: Fix handling of undefined instruction aborts in THUMB2 mode. 2021-11-02 11:11:44 +01:00
unwind.c arm/unwind: Check stack pointer boundaries before dereferencing 2023-07-27 15:44:00 -04:00
vfp.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vm_machdep.c arm: Fix initialization of VFP context 2023-02-23 17:50:26 +01:00