Add support for kprobes on ftrace call sites to avoid much of the overhead
with regular kprobes. Try it with simple steps:
cd /sys/kernel/debug/tracing/
echo 'p:myprobe sys_clone r0=%r0 r1=%r1 r2=%r2' > kprobe_events
echo 1 > events/kprobes/enable
echo 1 > events/k
The file struct is required in proc_mem_open() so its
f_mode can be checked when deciding whether to allow or
deny /proc/*/mem open requests via the new read/write
and foll_force restriction mechanism.
Thus instead of directly passing the inode to the fun,
we pass the file and get the inode inside
Prior to v2.6.39 write access to /proc//mem was restricted,
after which it got allowed in commit 198214a7ee50 ("proc: enable
writing to /proc/pid/mem"). Famous last words from that patch:
"no longer a security hazard". :)
Afterwards exploits started causing drama like [1]. The exploits
using /proc