freebsd-dev/sys
Mark Johnston 1253de1eb6 Invalidate the mapping before updating its physical address.
Doing so ensures that all threads sharing the pmap have a consistent
view of the mapping.  This fixes the problem described in the commit
log messages for r329254 without the overhead of an extra fault in the
common case.  Once other pmap_enter() implementations are similarly
modified, the workaround added in r329254 can be removed, reducing the
overhead of CoW faults.

With this change we can reuse the PV entry from the old mapping,
potentially avoiding a call to reclaim_pv_chunk().  Otherwise, there is
nothing preventing the old PV entry from being reclaimed.  In rare
cases this could result in the PTE's page table page being freed,
leading to a use-after-free of the page when the updated PTE is written
following the allocation of the PV entry for the new mapping.

Reported and tested by:	pho
Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D16005
2018-06-28 21:40:31 +00:00
..
amd64 Invalidate the mapping before updating its physical address. 2018-06-28 21:40:31 +00:00
arm [rpi] Add SDHOST device driver for Raspberry Pi 2018-06-28 21:14:33 +00:00
arm64 Add stub arm64 linuxulator VDSO ldscript 2018-06-28 20:36:21 +00:00
bsm
cam Fix setting RCA for MMC cards 2018-06-19 20:02:03 +00:00
cddl This originated from ZFS On Linux, as 2018-06-08 17:38:28 +00:00
compat Split kern_break from sys_break and use it in linuxulator 2018-06-27 14:45:13 +00:00
conf [rpi] Add SDHOST device driver for Raspberry Pi 2018-06-28 21:14:33 +00:00
contrib Really fix the style. 2018-06-19 18:43:02 +00:00
crypto aesni(4): Fix {de,en}crypt operations that allocated a buffer 2018-06-23 18:20:17 +00:00
ddb Extend show proc with reaper, sigparent, and vmspace information 2018-05-25 13:59:48 +00:00
dev Add missing MODULE_VERSION() and MODULE_DEPEND(). 2018-06-28 17:07:20 +00:00
dts Add spi-max-frequency properties to all spigen nodes. This is a required 2018-06-23 22:55:22 +00:00
fs Set the slotid and ND_HASSLOTID flag for NFSv4.1 sequenced operations. 2018-06-23 00:48:45 +00:00
gdb
geom gpart: add EFI alias for MBR partition scheme 2018-06-17 20:10:48 +00:00
gnu dts: Update our copy to Linux 4.17 2018-06-14 07:12:10 +00:00
i386 Fix the Linux kernel version number calculation 2018-06-22 00:02:03 +00:00
isa
kern Correct r335242. Use unsigned cast instead of abs(). Using abs() gives 2018-06-27 22:00:50 +00:00
kgssapi
libkern Sync strlcpy with userland version, again 2018-06-21 17:35:13 +00:00
mips Support 2GB of memory on Malta systems with FreeBSD/mips. 2018-06-28 21:27:34 +00:00
modules Partial revert of r335399 and r335400: 2018-06-26 23:28:03 +00:00
net Add NULL pointer check. 2018-06-28 11:39:27 +00:00
net80211 Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
netgraph Catch up two more places to the V_ifnet change to a CK_STAILQ. 2018-05-24 00:06:55 +00:00
netinet Add NULL pointer check. 2018-06-28 11:39:27 +00:00
netinet6 Add NULL pointer check. 2018-06-28 11:39:27 +00:00
netipsec uma: implement provisional api for per-cpu zones 2018-06-08 21:40:03 +00:00
netpfil pf: Support "return" statements in passing rules when they fail. 2018-06-22 21:59:30 +00:00
netsmb Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
nfs Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). 2018-06-16 08:26:23 +00:00
nfsclient
nfsserver
nlm
ofed Revert r335094 and properly fix OFED build after r335053. 2018-06-14 07:55:10 +00:00
opencrypto cryptosoft: Do not exceed crd_len around *crypt_multi 2018-04-19 15:24:21 +00:00
powerpc Expose stopped cpu contexts to ddb on PowerPC 2018-06-25 22:05:33 +00:00
riscv PLIC driver was sponsored by ECATS contract, not CTSRD one. 2018-06-21 11:52:09 +00:00
rpc
security Fix build breakage in veriexec for 32-bit architectures. 2018-06-20 06:54:38 +00:00
sparc64 Define memmove and make bcopy alt entry point 2018-05-24 21:11:28 +00:00
sys Fix compilation error in r335765 under gcc 4.2.1. 2018-06-28 20:37:17 +00:00
teken teken: Fix sequences header which was crossing the 80-col boundary 2018-05-29 08:41:44 +00:00
tests epoch(9): Make epochs non-preemptible by default 2018-05-18 17:29:43 +00:00
tools
ufs Use buf + strategy rather than bypassing geom_vfs layer 2018-06-26 00:39:38 +00:00
vm Reflow one of the comments describing vm_phys_alloc_npages(). 2018-06-28 17:52:06 +00:00
x86 xen: obtain vCPU ID from CPUID 2018-06-26 15:00:54 +00:00
xdr
xen xen: remove dead code from gnttab.h 2018-05-25 08:44:00 +00:00
Makefile