From 662866981e5172499a14585b8ff04ac3eb0371cc Mon Sep 17 00:00:00 2001 From: Nirjas Jakilim Date: Wed, 2 Apr 2025 18:02:29 +0600 Subject: [PATCH] adding unshare back to fix hang issue wrapper arm version is highly dependent on the child parent process structure. so without unshare the child process may never exit causing the hang issue. --- wrapper.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wrapper.c b/wrapper.c index 511f116..f698594 100644 --- a/wrapper.c +++ b/wrapper.c @@ -34,7 +34,12 @@ int main(int argc, char *argv[], char *envp[]) { mknod("/dev/urandom", S_IFCHR | 0666, makedev(0x1, 0x9)); chmod("/system/bin/linker64", 0755); chmod("/system/bin/main", 0755); - + + if (unshare(CLONE_NEWPID)) { + perror("unshare"); + return 1; + } + child_proc = fork(); if (child_proc == -1) { perror("fork"); @@ -53,4 +58,4 @@ int main(int argc, char *argv[], char *envp[]) { execve("/system/bin/main", argv, envp); perror("execve"); return 1; -} \ No newline at end of file +}