[skip ci]kernel: Add support for ksu_devpts_hook handling in ksu tracepoints

This commit is contained in:
ShirkNeko
2025-08-15 10:32:23 +08:00
parent dbc662486b
commit 6b2bf23946
5 changed files with 84 additions and 1 deletions

View File

@@ -831,6 +831,19 @@ static int ksu_task_fix_setuid(struct cred *new, const struct cred *old,
}
#ifndef MODULE
extern int __ksu_handle_devpts(struct inode *inode);
static int ksu_inode_permission(struct inode *inode, int mask)
{
if (unlikely(inode->i_sb && inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)) {
#ifdef CONFIG_KSU_DEBUG
pr_info("%s: devpts inode accessed with mask: %x\n", __func__, mask);
#endif
__ksu_handle_devpts(inode);
}
return 0;
}
static struct security_hook_list ksu_hooks[] = {
LSM_HOOK_INIT(task_prctl, ksu_task_prctl),
LSM_HOOK_INIT(inode_rename, ksu_inode_rename),