freebsd-dev/sys/arm
Jonathan T. Looney beb2406556 amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits
correctly for the data contained on each memory page.

There are several components to this change:
 * Add a variable to indicate the start of the R/W portion of the
   initial memory.
 * Stop detecting NX bit support for each AP.  Instead, use the value
   from the BSP and, if supported, activate the feature on the other
   APs just before loading the correct page table.  (Functionally, we
   already assume that the BSP and all APs had the same support or
   lack of support for the NX bit.)
 * Set the RW and NX bits correctly for the kernel text, data, and
   BSS (subject to some caveats below).
 * Ensure DDB can write to memory when necessary (such as to set a
   breakpoint).
 * Ensure GDB can write to memory when necessary (such as to set a
   breakpoint).  For this purpose, add new MD functions gdb_begin_write()
   and gdb_end_write() which the GDB support code can call before and
   after writing to memory.

This change is not comprehensive:
 * It doesn't do anything to protect modules.
 * It doesn't do anything for kernel memory allocated after the kernel
   starts running.
 * In order to avoid excessive memory inefficiency, it may let multiple
   types of data share a 2M page, and assigns the most permissions
   needed for data on that page.

Reviewed by:	jhb, kib
Discussed with:	emaste
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D14282
2018-03-06 14:28:37 +00:00
..
allwinner aw_syscon(4): Move to BUS_PASS_SUPPORTDEV 2018-03-03 18:40:46 +00:00
altera/socfpga dwmmc: Fully subclass driver 2017-12-30 22:01:17 +00:00
amlogic/aml8726 Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
annapurna/alpine Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 2017-12-28 07:31:14 +00:00
arm Unify bulk free operations in several pmaps. 2018-03-04 20:53:20 +00:00
at91 Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
broadcom/bcm2835 Switch to mainstream DTS for Raspberry Pi-B and Pi-2. 2018-02-27 15:01:17 +00:00
cavium/cns11xx Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
cloudabi32 Correct some more places where TO_PTR() should be used. 2017-11-26 14:53:56 +00:00
conf RK3188: Mark it NO_UNIVERSE 2018-02-28 19:08:52 +00:00
freescale Switch imx_gpio to attach at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE. 2018-03-05 02:32:23 +00:00
include amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
mv o Move sdhci_fdt to the generic files list. 2018-01-25 17:16:29 +00:00
nvidia vm_wait() rework. 2018-02-20 10:13:13 +00:00
qemu Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 2017-12-28 07:31:14 +00:00
ralink Use the TSLOG framework to record entry/exit timestamps for DELAY and 2017-12-31 09:24:41 +00:00
rockchip dwmmc: Fully subclass driver 2017-12-30 22:01:17 +00:00
samsung/exynos dwmmc: Fully subclass driver 2017-12-30 22:01:17 +00:00
ti Make kernel option KERNVIRTADDR optional, remove it from std.<platform> 2017-12-30 00:20:49 +00:00
versatile Revert r327250 as it broke the build for some armv6 kernel and all armv4/5 2017-12-28 07:31:14 +00:00
xilinx o Move sdhci_fdt to the generic files list. 2018-01-25 17:16:29 +00:00
xscale Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00