Skip to content

Commit

Permalink
KernelSU: Allowlist patch updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ravindu644 committed Apr 2, 2024
1 parent f696609 commit 6af5996
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ksu.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
return -ENOSYS;
}
// kernel 4.4 and 4.9
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) || defined(CONFIG_IS_HW_HISI)
+#if 1
static int ksu_key_permission(key_ref_t key_ref, const struct cred *cred,
unsigned perm)
Expand All @@ -13,7 +13,7 @@
LSM_HOOK_INIT(task_prctl, ksu_task_prctl),
LSM_HOOK_INIT(inode_rename, ksu_inode_rename),
LSM_HOOK_INIT(task_fix_setuid, ksu_task_fix_setuid),
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) || defined(CONFIG_IS_HW_HISI)
+#if 1
LSM_HOOK_INIT(key_permission, ksu_key_permission)
#endif
Expand All @@ -24,7 +24,7 @@
#endif
#include "klog.h" // IWYU pragma: keep

-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) || defined(CONFIG_IS_HW_HISI)
+#if 1
#include "linux/key.h"
#include "linux/errno.h"
Expand All @@ -33,7 +33,7 @@

struct file *ksu_filp_open_compat(const char *filename, int flags, umode_t mode)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) || defined(CONFIG_IS_HW_HISI)
+#if 1
if (init_session_keyring != NULL && !current_cred()->session_keyring &&
(current->flags & PF_WQ_WORKER)) {
Expand All @@ -44,7 +44,7 @@
const void __user *unsafe_addr,
long count);

-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) || defined(CONFIG_IS_HW_HISI)
+#if 1
extern struct key *init_session_keyring;
#endif

0 comments on commit 6af5996

Please sign in to comment.