FreeBSD Bugzilla – Attachment 167570 Details for
Bug 204426
Processes terminating cannot access memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Debugging patch to track source of KERN_PROTECTION_FAILURE
1.patch (text/plain), 2.23 KB, created by
Konstantin Belousov
on 2016-02-29 15:16:04 UTC
(
hide
)
Description:
Debugging patch to track source of KERN_PROTECTION_FAILURE
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2016-02-29 15:16:04 UTC
Size:
2.23 KB
patch
obsolete
>diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c >index cddf1eb..01f3d39 100644 >--- a/sys/vm/vm_fault.c >+++ b/sys/vm/vm_fault.c >@@ -263,6 +263,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, > int result; > > td = curthread; >+if ((td->td_pflags & TDP_NOFAULTING) != 0) printf("pid %d kpf 1\n", curproc->p_pid); > if ((td->td_pflags & TDP_NOFAULTING) != 0) > return (KERN_PROTECTION_FAILURE); > #ifdef KTRACE >@@ -425,6 +426,7 @@ fast_failed: > */ > if (fs.object->flags & OBJ_DEAD) { > unlock_and_deallocate(&fs); >+printf("pid %d kpf 2\n", curproc->p_pid); > return (KERN_PROTECTION_FAILURE); > } > >@@ -506,6 +508,7 @@ fast_failed: > fs.object == fs.first_object) { > if (fs.pindex >= fs.object->size) { > unlock_and_deallocate(&fs); >+printf("pid %d kpf 3 %jd %jd\n", curproc->p_pid, (uintmax_t)fs.pindex, (uintmax_t)fs.object->size); > return (KERN_PROTECTION_FAILURE); > } > >@@ -698,6 +701,7 @@ vnode_locked: > vm_page_unlock(fs.m); > fs.m = NULL; > unlock_and_deallocate(&fs); >+if (rv != VM_PAGER_ERROR) printf("pid %d kpf 4\n", curproc->p_pid); > return ((rv == VM_PAGER_ERROR) ? KERN_FAILURE : KERN_PROTECTION_FAILURE); > } > if (fs.object != fs.first_object) { >diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c >index 5e22b3e..deecc3a 100644 >--- a/sys/vm/vm_map.c >+++ b/sys/vm/vm_map.c >@@ -4011,6 +4011,7 @@ RetryLookup:; > prot = entry->protection; > fault_type &= (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); > if ((fault_type & prot) != fault_type || prot == VM_PROT_NONE) { >+printf("pid %d kpf 5 %x %x\n", curproc->p_pid, fault_type, prot); > vm_map_unlock_read(map); > return (KERN_PROTECTION_FAILURE); > } >@@ -4022,6 +4023,7 @@ RetryLookup:; > (entry->max_protection & VM_PROT_WRITE) == 0 && > (entry->eflags & MAP_ENTRY_COW) == 0) { > vm_map_unlock_read(map); >+printf("pid %d kpf 6\n", curproc->p_pid); > return (KERN_PROTECTION_FAILURE); > } > >@@ -4169,6 +4171,7 @@ vm_map_lookup_locked(vm_map_t *var_map, /* IN/OUT */ > */ > prot = entry->protection; > fault_type &= VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; >+if ((fault_type & prot) != fault_type) printf("pid %d kpf 7 %x %x\n", curproc->p_pid, fault_type, prot); > if ((fault_type & prot) != fault_type) > return (KERN_PROTECTION_FAILURE); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204426
: 167570 |
168808
|
168832
|
168870
|
168872
|
169679