forked from rovo89/Xposed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Xposed Installer's UID/GID in logcat/app service
These two access files written by Xposed Installer. If they're running with the same permissions as Xposed Installer, the files and directories don't need to be world-readable/writable. Note that even before, those processes didn't have any special permissions, despite UID 0. That's because they don't have the DAC_OVERRIDE capability, which would ignore file permissions. So instead of being able to read/write root's files, we can now read/write Xposed Installer's file (plus files readable/writable by anyone). One problem is that in order to determine the UID/GID of the Xposed Installer, the process needs to run in app context. But from this context, SELinux doesn't allow changing the UID anymore. Therefore, the UID/GID needs to be determined in some other way. This is done via a separate process which stats the directory and returns the result via shared memory. The processes which want to change their UID/GID can then do this before switching their context. This conflicts with single-process service mode (which was used as an optimization when SELinux is disabled) because only processes with special UIDs can add services. Therefore, we always need to use two services, one running as root in system context and one running with Xposed Installer's permissions in app context. The latter is actually processing requests, the first one is used for registering the services. It also requires that the logcat process runs with Xposed Installer's permission, but having AID_LOG as secondary group is sufficient to read all logcat entries.
- Loading branch information
Showing
5 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters