LKM that overwrites another process' memory space

view full story

http://stackoverflow.com – I'm writing a Loadable Kernel Module for Linux that overwrites data in the memory address of another process. I want to overwrite a 4-byte integer. Upon looking at ptrace(), I noticed a function named copy_from_user which, according to some documentation I found, seemed to fit the bill. However, when I try to load the module into the kernel (for a specific PID and address), it crashes. Here is my code: #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/moduleparam.h> #include <linux/pid.h> #include <linux/sched.h> (HowTos)