freebsd-dev/sys/arm64
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
..
acpica Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
arm64 Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
broadcom genet: pullup minimum header amount for IPv4 2021-06-26 11:04:02 -05:00
cavium Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
conf Add driver for marvell, a37x0 peripheral clocks 2022-01-04 13:26:35 +01:00
coresight arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
freescale/imx Add the clock for the imx8 thermal monitoring unit. 2021-09-28 11:51:57 -06:00
include Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
intel Add support for Intel Stratix 10 platform. 2019-09-13 16:50:57 +00:00
iommu Use the vm_radix_init() helper when initializing pmaps 2021-10-19 21:22:56 -04:00
linux exec: Simplify sv_copyout_strings implementations a bit 2021-12-31 12:50:15 -05:00
nvidia/tegra210 tegra210: Implement new get_gate method for tegra210 clocks. 2021-12-24 19:43:48 +01:00
qoriq Introduce qoriq_gpio_pic driver 2021-11-06 09:08:45 +01:00
qualcomm
rockchip rk_i2c_fill_tx: fixup previous commit 2021-12-15 13:21:16 +02:00