安全特性适配linux内核6.6

Signed-off-by: cbl <caobaolong5@huawei.com>
This commit is contained in:
cbl
2024-08-29 17:03:20 +08:00
parent c3adf85085
commit ec6c1bf379
4 changed files with 24 additions and 3 deletions
+6
View File
@@ -17,6 +17,7 @@
#include "avc.h"
#include "objsec.h"
#include "hideaddr.h"
#include <linux/version.h>
static bool is_anon_exec(struct vm_area_struct *vma)
{
@@ -44,8 +45,13 @@ static int hideaddr_avc_has_perm(u16 tclass, u32 requested, struct seq_file *m)
u32 secid;
security_cred_getsecid(task->cred, &secid);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
return avc_has_perm_noaudit(&selinux_state, secid, secid, tclass, requested,
AVC_STRICT, &avd);
#else
return avc_has_perm_noaudit(secid, secid, tclass, requested,
AVC_STRICT, &avd);
#endif
}
static void hideaddr_header_prefix(unsigned long *start, unsigned long *end,
+6
View File
@@ -11,6 +11,7 @@
#include "jit_space_list.h"
#include "avc.h"
#include "objsec.h"
#include <linux/version.h>
DEFINE_SPINLOCK(list_lock);
@@ -25,8 +26,13 @@ static bool jit_avc_has_perm(u16 tclass, u32 requested, struct task_struct *task
u32 secid;
security_cred_getsecid(task->cred, &secid);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
return (avc_has_perm_noaudit(&selinux_state, secid, secid, tclass, requested,
AVC_STRICT, &avd) == 0);
#else
return (avc_has_perm_noaudit(secid, secid, tclass, requested,
AVC_STRICT, &avd) == 0);
#endif
}
void find_jit_memory(struct task_struct *task, unsigned long start, unsigned long size, int *err)