kernel: refactor apply_kernelsu_rules to use mutex for synchronization

This commit is contained in:
ShirkNeko
2025-08-15 11:00:34 +08:00
parent f6337e2d52
commit ec6991f98b
2 changed files with 13 additions and 4 deletions

View File

@@ -267,9 +267,13 @@ static int execve_handler_pre(struct kprobe *p, struct pt_regs *regs)
static struct kprobe *su_kps[4];
static int pts_unix98_lookup_pre(struct kprobe *p, struct pt_regs *regs)
{
struct inode *inode;)
struct inode *inode;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
struct file *file = (struct file *)PT_REGS_PARM2(regs);
inode = file->f_path.dentry->d_inode;
#else
inode = (struct inode *)PT_REGS_PARM2(regs);
#endif
return ksu_inline_handle_devpts(inode);
}