kernel: adapt to kernel above 6.4 (#1196)

Above kernel 6.4, there is no struct_avc member in selinux_state.
This commit is contained in:
The_second_Tom
2023-12-11 00:13:06 +08:00
committed by GitHub
parent fa3dec8852
commit dcd9d65c92

View File

@@ -177,7 +177,8 @@ static int get_object(char *buf, char __user *user_object, size_t buf_sz,
// reset avc cache table, otherwise the new rules will not take effect if already denied // reset avc cache table, otherwise the new rules will not take effect if already denied
static void reset_avc_cache() static void reset_avc_cache()
{ {
#ifndef KSU_COMPAT_USE_SELINUX_STATE #if ((!defined(KSU_COMPAT_USE_SELINUX_STATE)) || \
LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0))
avc_ss_reset(0); avc_ss_reset(0);
selnl_notify_policyload(0); selnl_notify_policyload(0);
selinux_status_update_policyload(0); selinux_status_update_policyload(0);