On my device Magisk Hide does not work. (Discussion on XDA)
In short:
There is a mount problem.
Log after disable and enable Magisk Hide via terminal: magisk_v12_hide_error_log.txt
The mount commands are missing.
I found workarounds, but the kernel logcat support runs. I didn't change the logger buffer size from 256.000. Systemeless Hosts and Busybox are deactivated. The Core Only Mode didn't change anything.
In Error log (Magisk v13), I found this line is interesting:
readlink /proc/1/ns/mnt failed with 2: No such file or directory
Some tests about this line pointed out, that the mnt namespace is not there. (terminal_sessions.txt)
I found out, that only the IPC, Network and UTS namespaces are supported since Linux 3.0 (source). The MNT namespace is supported in Kernel versions 3.8 and higher. Unfortunately there is no kernel with a higher version for my device. :/
I maybe found the problem in hide_daemon.c line 77 . The mnt namespace is accessed and if there is an error, nothing happens.
Thanks to @topjohnwu for the good work :)
Samsung Galaxy S3 (i9300)
Note: I tested also the actual boeffla kernel, but same issue
Here is the boot.img of the LineageOS (14.1) Build 2017-05-17
I am having exactly the same issue on Nexus 7 (2012) - Grouper and idendtified the same line as the cause of the error. Probably we need a backport of mnt namespace support integrated into the kernel, or is there another solution?
Thanks to @topjohnwu for the good work :)
Hey AndDiSa!
Good to hear, that I am not alone with this issue. :)
I think there are 2 options.
The first one is that we update our Kernels. But a kernel update is very difficult especially for smartphones and I am not an expert in this area. I think there are not so much persons which can do it and want to do this for these outdated devices and kernels. And every person who wants to use magisk on an old device and an old kernel version has to do this. (if someone find out, how to backport the mnt namespace, it would also be an option ;) )
The second option is, that magisk supports devices without the mnt namespace. The mount command works on my kernel version, "Only" the namespace is not available. Maybe there is a possibility to support old kernels?
I think we have the same issue on my Mi 5, but the kernel on this device is 3.18.31
I don't think so. In your log, you have this line:
proc_monitor: init ns=mnt:[4026531840]
So the mnt namespace was found. I think you have an issue with sqlite3.
Oh... But then I don't know what that means, nor how to fix it... But v13 is still under development, we'll see...
You maybe can ask in the xda forum or open a new issue.
Hey guys! I have exactly the same issue with mnt namespace.
I consider this issue affects all kernels below the version 3.8. The idea of backport looks crazy and probably nearly impossible.
Looks like the problem also in proc_monitor.c. It working with mnt namespace which doesn't exists in old kernels.
As AndDiSa said, the kernel on Nexus 7 is at version 3.1.10, mnt namespace support was full for Linux 3.8, but I have full support for Magisk Hide and Safety net passing on my Moto G 2014 (Titan) with kernel 3.4.113 extended on AEX ROM. So I think it's possible to get kernels below version 3.8 to have Magisk hide support.
Moto G 2014
AEX 4.2
Kernel 3.4.113 extended
The Nexus 7 device as AndDiSa above - no support for Magisk hide.
@AndDiSa I think you are right. On Nougat 7.1.2 kernel 3.4.* fully supported by MagiskHide and mount namespace.
However, stock kernel 3.4.10 in Android 5.0.2 doesn't support namespace (or maybe it is the Android L itself).
I tried to install different Magisk versions from v. 11.1 to today build v. 13, tried to flash stock android 5.1 GPE to my HTC One M7 - Magisk Hide still not working.
I just saw in logs:
Zygote(0) ns= without the actual mount and expected strings "/unmount *"readlink /proc/1/ns/mnt failed with 2: No such file or directorySo, my only hope that @topjohnwu will fix this.
@pehlm do you have a link to the kernel sources fo 3.4.113? Probably one get get some hints for a backport.
It's indeed been backported in the android-3.4 kernel branch. See the commits starting from this page.
The specific one of interest that actually add /proc/\ There are preceeding commits for VFS that seem relevant to backporting this for the Linux 3.4 kernel. For sure older kernels will require some more work to backport this functionality.vfs: Add setns support for the mount namespace
vfs: Add a user namespace reference from struct mnt_namespace
vfs: Only support slave subtrees across different user namespaces
vfs: Allow unprivileged manipulation of the mount namespace.
@Decatf I was looking at the original patches from Eric Biederman, thank you for your link to the 3.4 intergration
Same problem. #221
I update kernel to 3.4.0 https://forum.xda-developers.com/k920/development/kernel-custom-kernel-lenovo-vibe-z2-pro-t3162383
It did not help.
@ImpGL
Are you still getting the same error in the Magisk log? It's perfectly possible that particular kernel doesn't have the necessary commits added... Looking at the source and comparing with the linked source above it does look like it is missing some necessary code.
** Magisk post-fs mode running...
** Magisk post-fs-data mode running...
* Running post-fs-data.d
* Loading core props
* Preparing modules
* Stage 1: Mount system and vendor mirrors
* Stage 2: Mount dummy skeletons
* Stage 3: Mount module items
* Stage 4: Execute module scripts
* Stage 5: Mount mirrored items back to dummy
** Magisk late_start service mode running...
* Enabling systemless hosts file support
* Enabling BusyBox
* Linking binaries to /sbin
* Starting MagiskSU
* Running service.d
* Starting MagiskHide
MagiskHide: Moving and re-linking /sbin binaries
MagiskHide: Removing dangerous read-only system props
MagiskHide: resetprop by nkk71 & topjohnwu
Initializing...
Modify data structure: 'ro.debuggable'='0'
Existing property: 'ro.debuggable'='1'
Recheck property: 'ro.debuggable'='0'
Done!
MagiskHide: resetprop by nkk71 & topjohnwu
Initializing...
Modify data structure: 'ro.secure'='1'
Existing property: 'ro.secure'='0'
Recheck property: 'ro.secure'='1'
Done!
MagiskHide: Killing com.google.android.gms.unstable
MagiskHide: Starting MagiskHide daemon
MagiskHide: Update process/package list:
MagiskHide: [com.google.android.gms.unstable]
Zygote(0) ns=�
MagiskHide: com.google.android.gms.unstable(PID=4634 ns=[0 4634 10009 com.google.android.gms.unstable service com.google.android.gms/.droidguard.DroidGuardService]
)
Yup... Without looking closer at the source (and I'm not really qualified for that) I'd say it's likely that kernel doesn't have the necessary mount namespace support either.
Same problem,like everything is the same as OP.
I9300, same rom, just boeffla kernel difference
@Aniums
Then you need to find a kernel with the proper commits or with a Linux version of at least 3.8.
@Didgeridoohan
Unfortunatly, there is no kernel for i9300 :/
Is there no possibility to support older kernels in Magisk?
From the Magisk release thread:
MagiskHide does not work on devices running Linux kernel version lower than 3.8
These old kernels lack critical features for hiding Magisk, so it CANNOT be fixed
From what we've seen above it is possible to add the necessary commits to an older kernel, but that's not a Magisk issue and needs to be fixed on the kernel side.
@Didgeridoohan
Okay, that is disappointing. :(
Thanks for your help!
The commits highlighted above does not seem to work. i assume a lot more has to be done even on 3.4.0 kernels. If only we can identify the specific commits only and confirm it works rather than having to update to 3.4.113
As mentioned in known issues in the XDA thread, so closed
Most helpful comment
I am having exactly the same issue on Nexus 7 (2012) - Grouper and idendtified the same line as the cause of the error. Probably we need a backport of mnt namespace support integrated into the kernel, or is there another solution?
Thanks to @topjohnwu for the good work :)