Skip to content

Commit f57d351

Browse files
rhjdvsgsgksbackslashxx
authored andcommitted
Init session keyring for samsung
Patch provided by user 'rhjdvsgsgks' on github. Fixes: #1249 #1346
1 parent 3291538 commit f57d351

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

kernel/core_hook.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@ static int ksu_task_prctl(int option, unsigned long arg2, unsigned long arg3,
692692
ksu_handle_prctl(option, arg2, arg3, arg4, arg5);
693693
return -ENOSYS;
694694
}
695-
// kernel 4.4 and 4.9
696-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
695+
// force for samsung
696+
#if 1
697697
static int ksu_key_permission(key_ref_t key_ref, const struct cred *cred,
698698
unsigned perm)
699699
{
@@ -726,7 +726,7 @@ static struct security_hook_list ksu_hooks[] = {
726726
LSM_HOOK_INIT(task_prctl, ksu_task_prctl),
727727
LSM_HOOK_INIT(inode_rename, ksu_inode_rename),
728728
LSM_HOOK_INIT(task_fix_setuid, ksu_task_fix_setuid),
729-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
729+
#if 1
730730
LSM_HOOK_INIT(key_permission, ksu_key_permission)
731731
#endif
732732
};

kernel/kernel_compat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "linux/uaccess.h"
1010
#include "klog.h" // IWYU pragma: keep
1111

12-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
12+
#if 1
1313
#include "linux/key.h"
1414
#include "linux/errno.h"
1515
#include "linux/cred.h"
@@ -78,7 +78,7 @@ void ksu_android_ns_fs_check()
7878

7979
struct file *ksu_filp_open_compat(const char *filename, int flags, umode_t mode)
8080
{
81-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
81+
#if 1
8282
if (init_session_keyring != NULL && !current_cred()->session_keyring &&
8383
(current->flags & PF_WQ_WORKER)) {
8484
pr_info("installing init session keyring for older kernel\n");

kernel/kernel_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern long ksu_strncpy_from_user_nofault(char *dst,
99
const void __user *unsafe_addr,
1010
long count);
1111

12-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
12+
#if 1
1313
extern struct key *init_session_keyring;
1414
#endif
1515

0 commit comments

Comments
 (0)