I am writing a Linux kernel module using Kprobes
to trace specific system calls, and I need to write to a file from within a KProbe
handler (specifically, a Kretprobe
). I know this is generally not advised, but I need to write the output to a very specific location, so I can't use any standard logging mechanisms.
I can open/write fine from the init()
function in the module, but when I try to do so from within a probe handler, the kernel crashes.