freebsd-nq/sys
Alan Cox 59677d3c0e Prevent the leakage of wired pages in the following circumstances:
First, a file is mmap(2)ed and then mlock(2)ed.  Later, it is truncated.
Under "normal" circumstances, i.e., when the file is not mlock(2)ed, the
pages beyond the EOF are unmapped and freed.  However, when the file is
mlock(2)ed, the pages beyond the EOF are unmapped but not freed because
they have a non-zero wire count.  This can be a mistake.  Specifically,
it is a mistake if the sole reason why the pages are wired is because of
wired, managed mappings.  Previously, unmapping the pages destroys these
wired, managed mappings, but does not reduce the pages' wire count.
Consequently, when the file is unmapped, the pages are not unwired
because the wired mapping has been destroyed.  Moreover, when the vm
object is finally destroyed, the pages are leaked because they are still
wired.  The fix is to reduce the pages' wired count by the number of
wired, managed mappings destroyed.  To do this, I introduce a new pmap
function pmap_page_wired_mappings() that returns the number of managed
mappings to the given physical page that are wired, and I use this
function in vm_object_page_remove().

Reviewed by: tegge
MFC after: 6 weeks
2007-11-17 22:52:29 +00:00
..
amd64 Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
arm Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
boot Add a trailing \0 to the read error string so that read errors don't print 2007-11-17 17:32:40 +00:00
bsm Merge OpenBSM 1.0 changes to src/sys/bsm: 2007-10-29 18:47:25 +00:00
cam Fix a change in the previous commit that was actually a type-o. 2007-11-15 16:23:38 +00:00
cddl Warn if kmem_map size is set to less than 512MB. Previous warning was a bit 2007-11-07 14:44:31 +00:00
compat Implement LINUX_SIOCGIFCOUNT and LINUX_SIOCGIFINDEX/LINUX_SIOGIFINDEX. 2007-11-07 16:42:52 +00:00
conf Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was 2007-11-12 21:51:38 +00:00
contrib Warn if kmem_map size is set to less than 512MB. Previous warning was a bit 2007-11-07 14:44:31 +00:00
crypto Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSEC 2007-07-03 12:13:45 +00:00
ddb Make the examine command honor db_pager_quit so you can use 'q' or 'x' 2007-10-27 20:19:11 +00:00
dev Make VPD register access more robust: 2007-11-16 20:49:34 +00:00
fs o Mask maximum file permissions we get from mount_ntfs -m 2007-11-17 17:05:01 +00:00
gdb Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
geom o s/resiserfs_sb/reiserfs_sb/. 2007-11-16 19:43:26 +00:00
gnu Remove duplicate "union" from ext2_opts. 2007-10-27 16:14:33 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
ia64 Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
isa Split /dev/nvram driver out of isa/clock.c for i386 and amd64. I have not 2007-10-26 03:23:54 +00:00
kern Acquire the process mutex and spin locks before calling thread_exit() in 2007-11-15 21:45:17 +00:00
libkern Do not use __XSCALE__ to detect if clz is available, use _ARM_ARCH_5 instead. 2007-10-13 12:05:36 +00:00
modules Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was 2007-11-12 21:51:38 +00:00
net 1) dummynet_io() declaration has changed. 2007-11-06 23:01:42 +00:00
net80211 correct MIMO power save action frame format; 2007-11-14 21:28:48 +00:00
netatalk Move towards more explicit support for various network protocol stacks 2007-10-28 15:55:23 +00:00
netatm Disconnect netatm from the build as it is not MPSAFE and relies on 2007-07-14 21:49:24 +00:00
netgraph - Merge all the ng_send_fn2* functions into one - ng_send_fn2(), 2007-11-14 11:25:58 +00:00
netinet - New sysctl variable: net.inet.ip.dummynet.io_fast 2007-11-17 21:54:57 +00:00
netinet6 Move towards more explicit support for various network protocol stacks 2007-10-28 15:55:23 +00:00
netipsec Move the priv check before the malloc call for so_pcb. 2007-11-16 22:35:33 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm s/destory/destroy/ (except for the code in contrib/). 2007-04-16 12:31:35 +00:00
netncp Commit 14/14 of sched_lock decomposition. 2007-06-05 00:00:57 +00:00
netsmb Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfs
nfs4client Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfsclient Add the following mount options to the nfs_opts array: 2007-10-27 16:28:05 +00:00
nfsserver Garbage collect now-unused nfsrv_setcred() -- it's not only unused, but 2007-11-04 19:20:33 +00:00
opencrypto Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
pc98 MFi386: revision 1.661 2007-11-14 12:29:09 +00:00
pccard
pci Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was 2007-11-12 21:51:38 +00:00
powerpc Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
rpc Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
security Implement per-object type consistency checks for labels passed to 2007-10-30 00:01:28 +00:00
sparc64 Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
sun4v Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
sys - Adds event handlers for process_ctor,process_dtor, process_init, 2007-11-15 14:20:07 +00:00
tools
ufs Fix build without INVARIANTS and update a comment to match 2007-11-09 11:04:36 +00:00
vm Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
Makefile Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/coda 2007-07-12 21:04:58 +00:00