-
Book Overview & Buying
-
Table Of Contents
Exploring SE for Android
By :
We saw init computing of the contexts for the init sockets, but we never encountered it while setting the domains for child processes. In this section, we will dive into the two techniques to do so: explicit setting with an init script and sepolicy dynamic domain transitions.
The first way to the domains for child processes is with the seclabel statement in the init script service declaration. Within the child processes execution after fork(), we find this statement:
if (svc->seclabel) {
if (is_selinux_enabled() > 0 && setexeccon(svc->seclabel) < 0) {
ERROR("cannot setexeccon('%s'): %s\n", svc->seclabel, strerror(errno));
_exit(127);
}
}To clarify, the svc variable is the structure that contains the service options and arguments, so svc->seclabel is seclabel. If it's set, it calls setexeccon(), which sets the process' execution context for anything it executes via exec(). Further down, we see that the exec() function calls are made. The...
Change the font size
Change margin width
Change background colour