* use sys_enter tracepoint for sucompat * update sucompat rules * clean tif mark * mark tif after load allow list * clear all tif first, then mark target * Fix shell su * allow when escape * fix bugs * kernel: Resolve logical inconsistencies --------- Co-authored-by: Ylarod <me@ylarod.cn> Co-authored-by: weishu <twsxtd@gmail.com>
41 lines
934 B
C
41 lines
934 B
C
#ifndef __KSU_H_SELINUX
|
|
#define __KSU_H_SELINUX
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/version.h>
|
|
#include "linux/sched.h"
|
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || defined(KSU_COMPAT_HAS_SELINUX_STATE)
|
|
#define KSU_COMPAT_USE_SELINUX_STATE
|
|
#endif
|
|
|
|
void setup_selinux(const char *);
|
|
|
|
void setenforce(bool);
|
|
|
|
bool getenforce(void);
|
|
|
|
bool is_task_ksu_domain(const struct cred* cred);
|
|
|
|
bool is_ksu_domain(void);
|
|
|
|
bool is_zygote(const struct cred* cred);
|
|
|
|
void apply_kernelsu_rules(void);
|
|
|
|
#ifdef CONFIG_KSU_SUSFS_SUS_MOUNT
|
|
bool susfs_is_sid_equal(void *sec, u32 sid2);
|
|
u32 susfs_get_sid_from_name(const char *secctx_name);
|
|
u32 susfs_get_current_sid(void);
|
|
void susfs_set_zygote_sid(void);
|
|
bool susfs_is_current_zygote_domain(void);
|
|
void susfs_set_ksu_sid(void);
|
|
bool susfs_is_current_ksu_domain(void);
|
|
void susfs_set_init_sid(void);
|
|
bool susfs_is_current_init_domain(void);
|
|
#endif
|
|
|
|
u32 ksu_get_devpts_sid(void);
|
|
|
|
#endif
|