2

As a part of an experiment i need to make a read-only page writable in kernel address space from a non-IOKit kext. In user mode i can do vm_protect, but there is surprisingly little info on how this can be done in kernel mode (or i am completely blind). Is there a call to do this?

Inso Reiges
  • 1,889
  • 3
  • 17
  • 30
  • Hi, I wonder if you manage to deal with this issue eventually, I'm currently trying to free memory after change it protection permissions with `vm_protect`, and get un-explained panic. perhaps you encountered such issue ? – Irad K Nov 13 '17 at 11:40

1 Answers1

0

In the kernel, it's declared in <mach/vm_map.h>, and is part of the "unsupported" KPI. (Add com.apple.kpi.unsupported to OSBundleRequired of your kext's info.plist) I unfortunately haven't used this function from the kernel before, so I can't really comment beyond that. vm_map_t appears to be a Mach Port reference, but I'm not sure where you'd get it from.

pmdj
  • 22,018
  • 3
  • 52
  • 103