Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171211538
D11421.id30260.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11421.id30260.diff
View Options
Index: head/sys/kern/kern_exec.c
===================================================================
--- head/sys/kern/kern_exec.c
+++ head/sys/kern/kern_exec.c
@@ -1091,6 +1091,10 @@
shmexit(vmspace);
pmap_remove_pages(vmspace_pmap(vmspace));
vm_map_remove(map, vm_map_min(map), vm_map_max(map));
+ /* An exec terminates mlockall(MCL_FUTURE). */
+ vm_map_lock(map);
+ vm_map_modflags(map, 0, MAP_WIREFUTURE);
+ vm_map_unlock(map);
} else {
error = vmspace_exec(p, sv_minuser, sv->sv_maxuser);
if (error)
Index: head/sys/vm/vm_map.c
===================================================================
--- head/sys/vm/vm_map.c
+++ head/sys/vm/vm_map.c
@@ -3557,25 +3557,23 @@
return (vm2);
}
+/*
+ * Create a process's stack for exec_new_vmspace(). This function is never
+ * asked to wire the newly created stack.
+ */
int
vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
vm_prot_t prot, vm_prot_t max, int cow)
{
vm_size_t growsize, init_ssize;
- rlim_t lmemlim, vmemlim;
+ rlim_t vmemlim;
int rv;
+ MPASS((map->flags & MAP_WIREFUTURE) == 0);
growsize = sgrowsiz;
init_ssize = (max_ssize < growsize) ? max_ssize : growsize;
vm_map_lock(map);
- lmemlim = lim_cur(curthread, RLIMIT_MEMLOCK);
vmemlim = lim_cur(curthread, RLIMIT_VMEM);
- if (!old_mlock && map->flags & MAP_WIREFUTURE) {
- if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) {
- rv = KERN_NO_SPACE;
- goto out;
- }
- }
/* If we would blow our VMEM resource limit, no go */
if (map->size + init_ssize > vmemlim) {
rv = KERN_NO_SPACE;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 10, 1:41 PM (7 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38441476
Default Alt Text
D11421.id30260.diff (1 KB)
Attached To
Mode
D11421: Fix MAP_WIREFUTURE leakage
Attached
Detach File
Event Timeline
Log In to Comment