File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ static struct policydb *get_policydb(void)
2424// selinux_state does not exists before 4.19
2525#ifdef KSU_COMPAT_USE_SELINUX_STATE
2626#ifdef SELINUX_POLICY_INSTEAD_SELINUX_SS
27- struct selinux_policy * policy = rcu_dereference ( selinux_state .policy ) ;
27+ struct selinux_policy * policy = selinux_state .policy ;
2828 db = & policy -> policydb ;
2929#else
30- struct selinux_ss * ss = rcu_dereference ( selinux_state .ss ) ;
30+ struct selinux_ss * ss = selinux_state .ss ;
3131 db = & ss -> policydb ;
3232#endif
3333#else
@@ -230,6 +230,8 @@ static void reset_avc_cache()
230230
231231int handle_sepolicy (unsigned long arg3 , void __user * arg4 )
232232{
233+ struct policydb * db ;
234+
233235 if (!arg4 ) {
234236 return -1 ;
235237 }
@@ -291,9 +293,9 @@ int handle_sepolicy(unsigned long arg3, void __user *arg4)
291293 subcmd = data .subcmd ;
292294#endif
293295
294- rcu_read_lock ( );
296+ mutex_lock ( & ksu_rules );
295297
296- struct policydb * db = get_policydb ();
298+ db = get_policydb ();
297299
298300 int ret = -1 ;
299301 if (cmd == CMD_NORMAL_PERM ) {
@@ -543,7 +545,7 @@ int handle_sepolicy(unsigned long arg3, void __user *arg4)
543545 }
544546
545547exit :
546- rcu_read_unlock ( );
548+ mutex_unlock ( & ksu_rules );
547549
548550 // only allow and xallow needs to reset avc cache, but we cannot do that because
549551 // we are in atomic context. so we just reset it every time.
You can’t perform that action at this time.
0 commit comments