kernel: refine syscall_hook_manager

- Don't unmark process when setuid if syscall tracepoint is in use
- Remark process when app profile updated
- Ensure zygote is marked on first boot
This commit is contained in:
5ec1cff
2025-11-13 19:50:54 +08:00
committed by ShirkNeko
parent 490cc39180
commit 9203006028
7 changed files with 68 additions and 28 deletions

View File

@@ -125,7 +125,7 @@ bool is_ksu_domain()
return is_task_ksu_domain(current_cred());
}
bool is_zygote(const struct cred* cred)
bool is_context(const struct cred* cred, const char* context)
{
if (!cred) {
return false;
@@ -140,11 +140,20 @@ bool is_zygote(const struct cred* cred)
if (err) {
return false;
}
result = strncmp("u:r:zygote:s0", ctx.context, ctx.len) == 0;
result = strncmp(context, ctx.context, ctx.len) == 0;
__security_release_secctx(&ctx);
return result;
}
bool is_zygote(const struct cred* cred)
{
return is_context(cred, "u:r:zygote:s0");
}
bool is_init(const struct cred* cred) {
return is_context(cred, "u:r:init:s0");
}
#define KSU_FILE_DOMAIN "u:object_r:ksu_file:s0"
u32 ksu_get_ksu_file_sid()