kernel: Remove redundant ksu_handle_inode_permission hooks, calling only for manual_su

This commit is contained in:
ShirkNeko
2025-11-13 15:02:20 +08:00
parent 14bb6afd0b
commit 7be8c15b85
5 changed files with 36 additions and 62 deletions

View File

@@ -174,29 +174,6 @@ int ksu_handle_execve_sucompat(const char __user **filename_user,
return 0;
}
int __ksu_handle_devpts(struct inode *inode)
{
if (!current->mm) {
return 0;
}
uid_t uid = current_uid().val;
if (uid % 100000 < 10000) {
// not untrusted_app, ignore it
return 0;
}
if (likely(!ksu_is_allow_uid_for_current(uid)))
return 0;
struct inode_security_struct *sec = selinux_inode(inode);
if (ksu_file_sid && sec)
sec->sid = ksu_file_sid;
return 0;
}
// sucompat: permitted process can execute 'su' to gain root access.
void ksu_sucompat_init()
{