0

I'm writing a kernel module that needs to change page permissions for a task. Normally, the task would just call mprotect and set the permissions. As I understand Linux kernel has sys_mprotect, which performs the actual system call.

Is it possible that my Linux kernel module calls sys_mprotect? I cannot seem to find a kernel API that allows that.

hsnm
  • 658
  • 1
  • 8
  • 20
  • Let's back up a second. Why do you think your kernel module needs to do this? –  Jul 09 '17 at 21:39

1 Answers1

0

I figured out it's possible to call sys_mprotect in a kernel module as explained here using kallsyms_lookup_name.

An alternative way for achieving some of the page permission changes is to directly call kernel APIs such as pte_wrprotect, which will clear the write permissions from a PTE.

hsnm
  • 658
  • 1
  • 8
  • 20