Magisk Root Request Blocking Issue with Older Versions
in Post with 0 comment

A bug affecting Magisk versions prior to 28.0 causes applications using Magisk's root access to become unresponsive. This issue primarily manifests when using methods to execute commands as root, such as the `ProcessBuilder` class with `su`.

Affected users have reported that their applications become stuck indefinitely when attempting to execute commands as root, regardless of the specific command used. This includes commands like `mount`, `cat`, reading `/proc/mounts`, `/proc/self/mounts`, or `/proc/self/mountinfo`. The `process.waitFor()` method will indefinitely report that the process hasn't exited.

**Affected Devices:**
Magisk version: v28.0 and some earlier. NOT on v26.4
Android version: any. Tested around 10-13

**Steps to reproduce:**

  1. Set Magisk to auto allow root requests.
  2. Create a demo Android app.
  3. Add the following code:
  4. Process process = new ProcessBuilder("su", "-c", "mount").start();
    process.waitFor(); // this blocks forever
    1. Run the app. Stuck forever. waitFor with timeout reports process hasn't exited

    The code running `mount` can be replaced with `cat` and any one of ` /proc/mounts`, ` /proc/self/mounts`, or `/proc/self/mountinfo`. They will all get stuck.
The article has been posted for too long and comments have been automatically closed.