DenyList unmount without magiskd

This commit is contained in:
topjohnwu
2021-10-27 03:54:48 -07:00
parent 983b74be77
commit 8bd6aca0dd
5 changed files with 13 additions and 69 deletions
-23
View File
@@ -202,17 +202,6 @@ std::vector<int> remote_get_info(int uid, const char *process, AppInfo *info) {
return fds;
}
int remote_request_unmount() {
if (int fd = connect_daemon(); fd >= 0) {
write_int(fd, ZYGISK_REQUEST);
write_int(fd, ZYGISK_UNMOUNT);
int ret = read_int(fd);
close(fd);
return ret;
}
return DAEMON_ERROR;
}
// The following code runs in magiskd
static bool get_exe(int pid, char *buf, size_t sz) {
@@ -373,15 +362,6 @@ static void get_process_info(int client, const sock_cred *cred) {
}
}
static void do_unmount(int client, const sock_cred *cred) {
if (denylist_enabled) {
LOGD("zygisk: cleanup mount namespace for pid=[%d]\n", cred->pid);
revert_daemon(cred->pid, client);
} else {
write_int(client, DENY_NOT_ENFORCED);
}
}
static void send_log_pipe(int fd) {
// There is race condition here, but we can't really do much about it...
if (logd_fd >= 0) {
@@ -405,9 +385,6 @@ void zygisk_handler(int client, const sock_cred *cred) {
case ZYGISK_GET_INFO:
get_process_info(client, cred);
break;
case ZYGISK_UNMOUNT:
do_unmount(client, cred);
break;
case ZYGISK_GET_LOG_PIPE:
send_log_pipe(client);
break;