freebsd-skq/sys
Jonathan T. Looney 31ba4c7b5b On bootup, the amd64 pmap initialization code creates page-table
mappings for the pages used for the kernel and some initial allocations
used for the page table. It maps the kernel and the blocks used for
these initial allocations using 2MB pages.

However, if the kernel does not end on a 2MB boundary, it still maps the
last portion using a 2MB page, but reports that the unused 4K blocks
within this 2MB allocation are free physical blocks. This means that
these same physical blocks could also be mapped elsewhere - for example,
into a user process. Given the proximity to the kernel text and data
area, it seems wise to avoid allowing someone to write data to physical
blocks also mapped into these virtual addresses.

(Note that this isn't a security vulnerability: the direct map makes
most/all memory on the system mapped into kernel space. And, nothing
in the kernel should be trying to access these pages, as the virtual
addresses are unused. It simply seems wise to avoid reusing these
physical blocks while they are mapped to virtual addresses so close
to the kernel text and data area.)

Consequently, let's reserve the physical blocks covered by the
page-table mappings for these initial allocations.

Reviewed by:	kib, markj
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D14268
2018-02-09 17:46:33 +00:00
..
amd64 On bootup, the amd64 pmap initialization code creates page-table 2018-02-09 17:46:33 +00:00
arm Cull Atmel board configs no longer relevant. 2018-02-07 18:33:53 +00:00
arm64 Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
bsm sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
cam Fix cut and pasted comments to reflect differences in code from the 2018-02-07 18:33:46 +00:00
cddl remove a duplicate assignment 2018-02-08 13:22:40 +00:00
compat Fix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to 2018-02-07 12:12:06 +00:00
conf Rework ipfw dynamic states implementation to be lockless on fast path. 2018-02-07 18:59:54 +00:00
contrib MFV r328490: Update libfdt to github:f1879e1 2018-01-27 21:25:45 +00:00
crypto ccp(4): Store IV in output buffer in GCM software fallback when requested 2018-01-27 07:41:31 +00:00
ddb Implement 'domainset', a cpuset based NUMA policy mechanism. This allows 2018-01-12 22:48:23 +00:00
dev iw_cxgbe: Remove declaration of a function that no longer exists. 2018-02-07 20:13:08 +00:00
dts Add a skeleton Clock Manager for RPi2/3, and use that from pwm 2018-01-22 07:10:30 +00:00
fs {ext2|ufs}_readdir: Avoid setting negative ncookies. 2018-02-06 22:38:19 +00:00
gdb sys/gdb: further adoption of SPDX licensing ID tags. 2017-11-27 15:16:59 +00:00
geom Simplify synchronization read error handling. 2018-02-06 16:02:33 +00:00
gnu bwn(4): migrate bwn(4) to the native bhnd(9) interface, and drop siba_bwn. 2018-02-05 23:38:15 +00:00
i386 Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
isa Add ISA PNP tables to ISA drivers. Fix a few incidental comments. 2018-01-29 00:22:30 +00:00
kern Fix boot_pages exhaustion on machines with many domains and cores, where 2018-02-09 04:45:39 +00:00
kgssapi sys/kgssapi: general adoption of SPDX licensing ID tags. 2017-11-27 15:49:00 +00:00
libkern SPDX: fix wrong license ID tag in libkern. 2017-12-28 01:20:30 +00:00
mips Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
modules Rework ipfw dynamic states implementation to be lockless on fast path. 2018-02-07 18:59:54 +00:00
net BPF: Switch to 32 bit compatible mode only when thread is 32 bit 2018-01-25 12:13:41 +00:00
net80211 net80211: sanitize input for ieee80211_output() 2017-12-30 00:40:34 +00:00
netgraph Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
netinet Rework ipfw dynamic states implementation to be lockless on fast path. 2018-02-07 18:59:54 +00:00
netinet6 Fix ICMPv6 redirects 2018-02-09 00:13:05 +00:00
netipsec Adopt revision 1.76 and 1.77 from NetBSD: 2018-01-24 19:48:25 +00:00
netpfil Remove duplicate #include <netinet/ip_var.h>. 2018-02-07 19:12:05 +00:00
netsmb Unsign some values related to allocation. 2018-01-22 02:08:10 +00:00
nfs Modernize nfssvc(2) registartion. 2018-02-08 20:09:42 +00:00
nfsclient style: Remove remaining deprecated MALLOC/FREE macros 2018-01-25 22:25:13 +00:00
nfsserver sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
nlm Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
ofed sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
opencrypto Move per-operation data out of the csession structure. 2018-01-26 23:21:50 +00:00
powerpc Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
riscv Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
rpc Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
security Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
sparc64 Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
sys Pull in r324594 from upstream clang trunk (by Alexander Ivchenko): 2018-02-08 21:11:48 +00:00
teken sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
tests
tools Avoid using \$. It's an unknown escape sequence. Some awks warn about 2018-01-28 05:13:08 +00:00
ufs The goal of this change is to prevent accidental foot shooting by 2018-02-08 23:06:58 +00:00
vm Fix boot_pages exhaustion on machines with many domains and cores, where 2018-02-09 04:45:39 +00:00
x86 Expand IBRS TLA in sysctl help lines. 2018-01-31 16:54:05 +00:00
xdr sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
xen sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
Makefile Move sys/boot to stand. Fix all references to new location 2017-11-14 23:02:19 +00:00