Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Jan 14, 2024
2 parents 829a80a + 5b920f8 commit c8a9dcc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/selinux/selinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ bool is_ksu_domain()
{
char *domain;
u32 seclen;
bool result;
int err = security_secid_to_secctx(current_sid(), &domain, &seclen);
if (err) {
return false;
}
return strncmp(KERNEL_SU_DOMAIN, domain, seclen) == 0;
result = strncmp(KERNEL_SU_DOMAIN, domain, seclen) == 0;
security_release_secctx(domain, seclen);
return result;
}

bool is_zygote(void *sec)
Expand All @@ -118,9 +121,12 @@ bool is_zygote(void *sec)
}
char *domain;
u32 seclen;
bool result;
int err = security_secid_to_secctx(tsec->sid, &domain, &seclen);
if (err) {
return false;
}
return strncmp("u:r:zygote:s0", domain, seclen) == 0;
result = strncmp("u:r:zygote:s0", domain, seclen) == 0;
security_release_secctx(domain, seclen);
return result;
}

0 comments on commit c8a9dcc

Please sign in to comment.