opnsense-src/sys/arm64/include
Andrew Turner 85b7c566f1 Add arm64 pointer authentication support
Pointer authentication allows userspace to add instructions to insert
a Pointer Authentication Code (PAC) into a register based on an address
and modifier and check if the PAC is correct. If the check fails it will
either return an invalid address or fault to the kernel.

As many of these instructions are a NOP when disabled and in earlier
revisions of the architecture this can be used, for example, to sign
the return address before pushing it to the stack making Return-oriented
programming (ROP) attack more difficult on hardware that supports them.

The kernel manages five 128 bit signing keys: 2 instruction keys, 2 data
keys, and a generic key. The instructions then use one of these when
signing the registers. Instructions that use the first four store the
PAC in the register being signed, however the instructions that use the
generic key store the PAC in a separate register.

Currently all userspace threads share all the keys within a process
with a new set of userspace keys being generated when executing a new
process. This means a forked child will share its keys with its parent
until it calls an appropriate exec system call.

In the kernel we allow the use of one of the instruction keys, the ia
key. This will be used to sign return addresses in function calls.
Unlike userspace each kernel thread has its own randomly generated.

Thread0 has a static key as does the early code on secondary CPUs.
This should be safe as there is minimal user interaction with these
threads, however we could generate random keys when the Armv8.5
Random number generation instructions are present.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31261
2022-01-12 15:27:17 +00:00
..
_align.h
_bus.h Regularize my copyright notice 2019-12-04 16:56:11 +00:00
_inttypes.h
_limits.h
_stdint.h
_types.h Reduce code duplication in machine/_types.h 2021-06-14 16:30:16 +01:00
acpica_machdep.h arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
armreg.h Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
asm.h Handle functions that use a nop in the arm64 fbt 2021-03-03 14:18:03 +00:00
atomic.h Add atomic_testandset_acq_* on arm64 2021-12-21 13:06:27 +00:00
bus.h Simplify kernel sanitizer interceptors 2021-07-29 21:13:32 -04:00
bus_dma.h Allow loading the same DMA address multiple times without any prior 2019-05-16 17:41:16 +00:00
bus_dma_impl.h bus_dma: Deduplicate locking helper functions. 2022-01-05 13:50:40 -08:00
clock.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
counter.h Allocate arm64 per-CPU data in the correct domain 2021-10-11 10:36:50 +01:00
cpu.h Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
cpufunc.h Allow ddb and dtrace use the DMAP region on arm64 2021-10-01 11:27:33 +01:00
csan.h arm64: Improve DDB backtrace support 2021-02-01 14:15:57 +00:00
db_machdep.h arm64: Fix a logic bug in is_load_instr(). 2021-09-15 09:03:18 -07:00
debug_monitor.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
disassem.h Framework for ARM64 instruction disassembler 2016-01-29 13:06:30 +00:00
dump.h minidump: De-duplicate the progress bar 2021-09-29 16:42:21 -03:00
efi.h smbios: support getting address from EFI 2021-04-07 14:46:29 -05:00
elf.h arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries. 2021-07-25 19:39:32 +10:00
endian.h Consolidate machine/endian.h definitions 2021-03-26 19:00:22 -03:00
exec.h
float.h Rationalize BSD license on sys/*/include/float.h 2015-08-05 17:05:35 +00:00
floatingpoint.h add floatingpoint.h for arm64 2015-06-24 14:51:53 +00:00
fpu.h Add machine/fpu.h on arm64 for compatibility with amd64. 2017-10-10 13:02:58 +00:00
frame.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
gdb_machdep.h gdb: report specific stop reason for watchpoints 2021-03-30 11:36:41 -03:00
hypervisor.h Update the arm64 HCR_EL2 registers 2021-07-14 19:28:16 +00:00
ieeefp.h arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
ifunc.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
in_cksum.h Rationalize BSD license on sys/*/include/in_cksum.h 2015-08-05 19:05:12 +00:00
intr.h arm64: Increase NIRQ to 16k 2020-10-15 03:12:00 +00:00
iodev.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
iommu.h Introduce IOMMU support for arm64 platform. 2020-11-16 21:55:52 +00:00
kdb.h arm64: implement kdb watchpoint functions 2021-03-29 12:05:43 -03:00
machdep.h Use L2 blocks when in the identity map 2021-03-03 14:18:03 +00:00
md_var.h Simplify swi for bus_dma. 2021-12-28 13:51:25 -08:00
memdev.h Add the MEM_EXTRACT_PADDR ioctl to /dev/mem. 2020-09-02 18:12:47 +00:00
metadata.h loader.efi: Make framebuffer commands available for arm64 2017-10-25 18:55:04 +00:00
minidump.h Sparsify the vm_page_dump bitmap 2020-09-21 22:21:59 +00:00
ofw_machdep.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
param.h arm64: Stop setting VM_BCACHE_SIZE_MAX 2021-01-19 20:34:35 -05:00
pcb.h arm64: remove pcb_pc 2021-01-08 14:53:44 -04:00
pci_cfgreg.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
pcpu.h Remove PCPU_INC 2021-03-20 19:23:59 -07:00
pcpu_aux.h Allocate arm64 per-CPU data in the correct domain 2021-10-11 10:36:50 +01:00
pmap.h Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
pmc_mdep.h libpmc/hwpmc: fix issues with arm64 pmu-events support 2021-07-21 20:18:00 -03:00
proc.h Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h arm64: fix uintfptr_t 2020-08-05 22:09:57 +00:00
psl.h Add support for arm64 to loader.efi and boot1.efi 2015-04-14 13:55:01 +00:00
pte.h Add the arm64 table attributes and use them 2021-09-29 17:53:41 +01:00
ptrace.h Add more arm64 machine dependent headers. With this we now have the minimum 2015-03-26 21:10:42 +00:00
reg.h arm64: Make machine/reg.h self contained 2021-11-23 21:21:17 -07:00
reloc.h
resource.h Define PCI_RES_BUS for NEW_PCIB 2016-05-19 14:00:18 +00:00
runq.h
setjmp.h Move the stored signal mask later in the jump buf. It was being clobbered 2016-12-06 13:46:12 +00:00
sf_buf.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
sigframe.h Follow arm[32] and sparc64 KAPI and provide the FreeBSD standard spelling 2019-01-29 20:10:27 +00:00
signal.h
smp.h Rename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng. 2016-03-18 16:29:58 +00:00
stack.h arm64: Improve DDB backtrace support 2021-02-01 14:15:57 +00:00
stdarg.h Introduce an architecture-agnostic <sys/_stdarg.h> to reduce 2017-12-25 20:54:00 +00:00
sysarch.h Add more arm64 machine dependent headers. With this we now have the minimum 2015-03-26 21:10:42 +00:00
tls.h Add <machine/tls.h> header to hold MD constants and helpers for TLS. 2021-12-09 13:17:13 -08:00
trap.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
ucontext.h arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
undefined.h Move ID reading signatures to a better header 2020-07-01 16:17:51 +00:00
vdso.h Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32. 2017-11-24 13:50:53 +00:00
vfp.h Remove the DN flag from the initial arm64 fpcr value 2021-09-14 12:52:48 +00:00
vm.h Add a way to map arm64 non-posted device memory 2021-05-01 06:01:20 +00:00
vmparam.h Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00