Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148499496
D20753.id58989.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
D20753.id58989.diff
View Options
Index: vm_map.c
===================================================================
--- vm_map.c
+++ vm_map.c
@@ -2454,6 +2454,7 @@
vm_object_t obj;
struct ucred *cred;
vm_prot_t old_prot;
+ int rv;
if (start == end)
return (KERN_SUCCESS);
@@ -2512,6 +2513,7 @@
* now will do cow due to allowed write (e.g. debugger sets
* breakpoint on text segment)
*/
+ rv = KERN_SUCCESS;
vm_map_clip_start(map, entry, start);
for (current = entry; current->start < end; current = current->next) {
@@ -2529,8 +2531,8 @@
if (obj == NULL || (current->eflags & MAP_ENTRY_NEEDS_COPY)) {
if (!swap_reserve(current->end - current->start)) {
- vm_map_unlock(map);
- return (KERN_RESOURCE_SHORTAGE);
+ rv = KERN_RESOURCE_SHORTAGE;
+ break;
}
crhold(cred);
current->cred = cred;
@@ -2553,8 +2555,8 @@
obj, current));
if (!swap_reserve(ptoa(obj->size))) {
VM_OBJECT_WUNLOCK(obj);
- vm_map_unlock(map);
- return (KERN_RESOURCE_SHORTAGE);
+ rv = KERN_RESOURCE_SHORTAGE;
+ break;
}
crhold(cred);
@@ -2567,8 +2569,10 @@
* Go back and fix up protections. [Note that clipping is not
* necessary the second time.]
*/
- for (current = entry; current->start < end; current = current->next) {
- if ((current->eflags & MAP_ENTRY_GUARD) != 0)
+ for (current = entry; current->start < end;
+ vm_map_simplify_entry(map, current), current = current->next) {
+ if ((current->eflags & MAP_ENTRY_GUARD) != 0 ||
+ rv != KERN_SUCCESS)
continue;
old_prot = current->protection;
@@ -2603,10 +2607,9 @@
current->protection & MASK(current));
#undef MASK
}
- vm_map_simplify_entry(map, current);
}
vm_map_unlock(map);
- return (KERN_SUCCESS);
+ return (rv);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 19, 6:56 AM (17 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29953129
Default Alt Text
D20753.id58989.diff (1 KB)
Attached To
Mode
D20753: simplify entries after vm_map_protect -> KERN_RESOURCE_SHORTAGE
Attached
Detach File
Event Timeline
Log In to Comment