aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2021-07-08 13:15:55 +0000
committerAndrew Turner <andrew@FreeBSD.org>2022-01-12 15:27:17 +0000
commit85b7c566f1538f9a2e85f76bf5b41380701987a7 (patch)
tree99648d6e304fb12df022f537db972648540c3de2 /sys/vm
parenta3cea156801790d0bbbb4cd9bede0ece8742af82 (diff)
downloadsrc-85b7c566f1538f9a2e85f76bf5b41380701987a7.tar.gz
src-85b7c566f1538f9a2e85f76bf5b41380701987a7.zip
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
Diffstat (limited to 'sys/vm')
0 files changed, 0 insertions, 0 deletions