Disable codepatching infrastructure after boot
authorsf <sf@openbsd.org>
Fri, 13 Jul 2018 08:30:34 +0000 (08:30 +0000)
committersf <sf@openbsd.org>
Fri, 13 Jul 2018 08:30:34 +0000 (08:30 +0000)
commit5f6ecb1939a610ea2cc43585708e659fc0834e52
treea8be7fe09271318b5489abcd5838f39f756e3f48
parent1b679b9b306484cbb0dd7005eff2ecf870a8f88d
Disable codepatching infrastructure after boot

This way, it is not available for use in ROP attacks.  This diff puts the
codepatching code into a separate section and unmaps that section after boot.
In the future, the memory could potentially be reused but that would require
larger changes.

ok pguenther@
sys/arch/amd64/amd64/codepatch.c
sys/arch/amd64/amd64/mainbus.c
sys/arch/amd64/conf/ld.script
sys/arch/amd64/include/codepatch.h