kernel: Fix compilation flags in Makefiles and optimize SELinux rule handling

Co-authored-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-06-12 15:43:24 +08:00
parent 80678a4475
commit 22db54c5d3
3 changed files with 49 additions and 70 deletions

View File

@@ -2,6 +2,9 @@
#include "objsec.h"
#include "linux/version.h"
#include "../klog.h" // IWYU pragma: keep
#ifdef SAMSUNG_SELINUX_PORTING
#include "security.h" // Samsung SELinux Porting
#endif
#ifndef KSU_COMPAT_USE_SELINUX_STATE
#include "avc.h"
#endif
@@ -72,18 +75,14 @@ void ksu_setup_selinux(const char *domain)
pr_err("transive domain failed.\n");
return;
}
/* we didn't need this now, we have change selinux rules when boot!
if (!is_domain_permissive) {
if (set_domain_permissive() == 0) {
is_domain_permissive = true;
}
}*/
}
void ksu_setenforce(bool enforce)
{
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
#ifdef SAMSUNG_SELINUX_PORTING
selinux_enforcing = enforce;
#endif
#ifdef KSU_COMPAT_USE_SELINUX_STATE
selinux_state.enforcing = enforce;
#else
@@ -105,6 +104,9 @@ bool ksu_getenforce()
#endif
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
#ifdef SAMSUNG_SELINUX_PORTING
return selinux_enforcing;
#endif
#ifdef KSU_COMPAT_USE_SELINUX_STATE
return selinux_state.enforcing;
#else