printk causes kernel panic when used to hook set_uid in sys_call_table

I am working on developing a rootkit for Ubuntu 18.04, kernel 5.0.0.37-generic. I’ve successfully hooked the sys_call_table using kallsyms, and enabled/disabled write. After hooking get_uid, I’ve found that when I execute the following code asmlinkage long set_uid(uid_t uid) { return (* old_setuid) (uid); } everything works as expected. However, when I run either of the…

Details