Skip to content

Commit

Permalink
kernel: adapt to kernel above 6.4
Browse files Browse the repository at this point in the history
Above kernel 6.4, selinux_state pointers and their offspring
are not passed to methods in ksu below:
- avc_ss_reset()
- selinux_status_update_policyload();
See https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/security/selinux/include/security.h?h=v6.6.5&id=e67b79850fcc4eb5816d69d34fd82aeda350aca7
  • Loading branch information
OnlyTomInSecond committed Dec 9, 2023
1 parent 1a308af commit 8a2a329
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/selinux/rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
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);
selnl_notify_policyload(0);
selinux_status_update_policyload(0);
Expand Down

0 comments on commit 8a2a329

Please sign in to comment.