Opening / writing to a file from the KProbe handler

I am writing a Linux kernel module using Kprobes to track specific system calls and I need to write to a file from a KProbe handler (specifically Kretprobe). I know this is generally not recommended, but I need to write the output to a very specific location, so I cannot use any standard logging mechanisms.

I can open / write fine from the init () function in the module, but when I try to do it from within the probe handler, the kernel crashes.

+3


source to share





All Articles