Skip to content

Commit

Permalink
Hide magisk internal mount point
Browse files Browse the repository at this point in the history
  • Loading branch information
vvb2060 authored and topjohnwu committed Dec 22, 2023
1 parent c48962b commit deedb46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions native/src/core/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ static void daemon_entry() {
ssprintf(path, sizeof(path), "%s/" ROOTOVL, tmp);
rm_rf(path);

// Unshare magiskd
xunshare(CLONE_NEWNS);
// Hide magisk internal mount point
xmount(nullptr, tmp, nullptr, MS_PRIVATE | MS_REC, nullptr);
// Fix sdcardfs bug on old kernel
xmount(nullptr, "/mnt", nullptr, MS_SLAVE | MS_REC, nullptr);

// Use isolated devpts if kernel support
if (access("/dev/pts/ptmx", F_OK) == 0) {
ssprintf(path, sizeof(path), "%s/" SHELLPTS, tmp);
Expand Down

0 comments on commit deedb46

Please sign in to comment.