I'm hijacking __NR_read
(sys_read
call) and each time I hijack the original syscall with my own syscall, it causes a crash in bash (in all open KDE "konsoles") (that is, as soon as I hijack sys_open
).
I'm wondering if this is a bug in my code (probably) or it's happening because of something else.
My question is: if the crash is caused because of my code, what is causing it exactly and how (if possible) can I fix it? If the crash isn't caused by my code, what is causing it?
My code is here: https://github.com/alexandernst/procmon/tree/master/procmon_kmodule
syshijack.c
is where I get the syscall table and hookfns.c
is where I hijack the syscalls.
PS: I already asked this question before here Hijacking sys calls but it changed now, as the crash happens as soon as I hijack the syscall.
* EDIT *
I think the bug is comming from hook/unhook calls, so I created an issue https://github.com/alexandernst/procmon/issues/7 Anyways, I can't see what is causing the crash/freeze.