File tree Expand file tree Collapse file tree 2 files changed +0
-33
lines changed Expand file tree Collapse file tree 2 files changed +0
-33
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,6 @@ ifeq ($(shell grep -q "struct selinux_state " $(srctree)/security/selinux/includ
4545ccflags-y += -DKSU_COMPAT_HAS_SELINUX_STATE
4646endif
4747
48- # This feature was introduced in linux 5.0-rc1
49- ifeq ($(shell grep -q "get_cred_rcu" $(srctree ) /include/linux/cred.h; echo $$? ) ,0)
50- ccflags-y += -DKSU_COMPAT_HAS_GET_CRED_RCU
51- else
52- ifeq ($(shell grep -q "atomic_long_t\s\+usage" $(srctree ) /include/linux/cred.h; echo $$? ) ,0)
53- ccflags-y += -DKSU_COMPAT_ATOMIC_LONG
54- endif
55- ifeq ($(shell grep -q "int\s\+non_rcu" $(srctree ) /include/linux/cred.h; echo $$? ) ,0)
56- ccflags-y += -DKSU_COMPAT_HAS_NONCONST_CRED
57- endif
58- endif
59-
6048# Handle optional backports
6149ifeq ($(shell grep -q "strncpy_from_user_nofault" $(srctree ) /include/linux/uaccess.h; echo $$? ) ,0)
6250ccflags-y += -DKSU_OPTIONAL_STRNCPY
Original file line number Diff line number Diff line change 77#include "ss/policydb.h"
88#include "linux/key.h"
99
10- // for kernel without get_cred_rcu
11- #ifndef KSU_COMPAT_HAS_GET_CRED_RCU
12- static inline const struct cred * get_cred_rcu (const struct cred * cred )
13- {
14- struct cred * nonconst_cred = (struct cred * ) cred ;
15- if (!cred )
16- return NULL ;
17- #ifdef KSU_COMPAT_ATOMIC_LONG
18- if (!atomic_long_inc_not_zero (& nonconst_cred -> usage ))
19- #else
20- if (!atomic_inc_not_zero (& nonconst_cred -> usage ))
21- #endif
22- return NULL ;
23- validate_creds (cred );
24- #ifdef KSU_COMPAT_HAS_NONCONST_CRED
25- nonconst_cred -> non_rcu = 0 ;
26- #endif
27- return cred ;
28- }
29- #endif
30-
3110/*
3211 * Adapt to Huawei HISI kernel without affecting other kernels ,
3312 * Huawei Hisi Kernel EBITMAP Enable or Disable Flag ,
You can’t perform that action at this time.
0 commit comments