You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
kernel: improve get_cred_rcu guard
Signed-off-by: rsuntk <rissu.ntk@gmail.com>
This commit is contained in:
@@ -60,9 +60,9 @@ ccflags-y += -DKSU_UMOUNT
|
|||||||
|
|
||||||
# This feature is introduced in linux 5.0-rc1
|
# This feature is introduced in linux 5.0-rc1
|
||||||
ifeq ($(shell grep -q "get_cred_rcu" $(srctree)/include/linux/cred.h; echo $$?),0)
|
ifeq ($(shell grep -q "get_cred_rcu" $(srctree)/include/linux/cred.h; echo $$?),0)
|
||||||
ccflags-y += -DKSU_GET_CRED_RCU
|
ccflags-y += -DKSU_COMPAT_GET_CRED_RCU
|
||||||
else
|
else
|
||||||
$(info -- Your kernel does not have get_cred_rcu, please backport it.)
|
$(info -- Your kernel does not support get_cred_rcu, please backport it.)
|
||||||
$(info -- How to backport: https://github.com/tiann/KernelSU/pull/2320#issuecomment-2564232958)
|
$(info -- How to backport: https://github.com/tiann/KernelSU/pull/2320#issuecomment-2564232958)
|
||||||
$(info -- Fallback to old changes.)
|
$(info -- Fallback to old changes.)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -45,6 +45,10 @@
|
|||||||
#include "throne_tracker.h"
|
#include "throne_tracker.h"
|
||||||
#include "kernel_compat.h"
|
#include "kernel_compat.h"
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) || defined(KSU_COMPAT_GET_CRED_RCU)
|
||||||
|
#define KSU_GET_CRED_RCU
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool ksu_module_mounted = false;
|
static bool ksu_module_mounted = false;
|
||||||
|
|
||||||
extern int handle_sepolicy(unsigned long arg3, void __user *arg4);
|
extern int handle_sepolicy(unsigned long arg3, void __user *arg4);
|
||||||
|
|||||||
Reference in New Issue
Block a user