Closed kolay-v closed 4 years ago
Problem seems to be due to deprecation of file_operations. Solution is to move to proc_ops. Below patch should work although it's inelegant (won't work on older kernel versions where proc_ops does not exist - I'll make it nicer later and send over a PR)
index 763a3c4..565bea1 100644
--- a/cartographer.c
+++ b/cartographer.c
@@ -245,7 +245,9 @@ end:
}
static struct ftrace_hook show_map_vma_hook;
-static struct file_operations file_ops;
+static struct proc_ops file_ops = {
+ .proc_write = on_write,
+};
/* Search for a symbol in kallsyms. Some contain version specific suffixes */
static int on_each_symbol(void *data, const char *name,
@@ -309,9 +311,6 @@ static int cart_startup(void)
return -ENOMEM;
}
- file_ops.owner = THIS_MODULE;
- file_ops.write = on_write;
-
cart_print("Cartographer Loading complete.\n");
return 0;
}
https://github.com/LWSS/Cartographer/pull/8 fixes this.
It fails with compilation error.
My kernel is
Linux kolay-arch 5.6.2-1-MANJARO #1 SMP PREEMPT Thu Apr 2 11:32:09 UTC 2020 x86_64 GNU/Linux