vm_protect from within the kernel
vm_protect from within the kernel
- Subject: vm_protect from within the kernel
- From: Chandra Khan <email@hidden>
- Date: Tue, 16 Nov 2004 10:58:30 -0800
Hi
I posted on this earlier, but here's another attempt with a different
slant. I'm really stuck on this after much searching, reading and
experimentation, and would appreciate any thoughts.
Do you see any "gotchas" or anything "bad" with using any of the
following calls - vm_region, vm_protect, vm_read, vm_write,
vm_machine_attribute - on current_map() from within the process
context in kernel mode?
I use these calls from within the kernel to write instructions to a
process's address space. I had to use the VM_PROT_COPY flag when the
user address in question was in the commpage area. It appears that the
kernel gets unhandled faults on any further accesses to the commpage
(such as by ntpd).
My understanding: the commpage (0xffff8000-0xffffefff) is mapped
shared and read-only into every process's space. Since my target
process now wants to write to it, and changed protections to COW, the
kernel creates a separate backing store for the overwritten pages.
This should not affect either the protections, or the contents, or the
sharing level, of the commpages for any other process. On a related
note, gdb seems to get away with doing this -- What am I missing?
Thanks
Chandra
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden