topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.58k stars 12.08k forks source link

Magisk 27.0 no longer works with easySSHFS "fuse.sshfs is not in /proc/mounts" - Mount Namespace Modes issue #7822

Closed ampersandru closed 7 months ago

ampersandru commented 7 months ago

EasySSHFS was working in Magisk 26.4 (26400) - upgraded to 27001 and it no longer works when mounting remote folders. App log shows the error "fuse.sshfs is not in /proc/mounts"

Based on the following thread, its likely due to a Mount Namespace Modes issue and possibly regressed in 27.0 with --mount-master https://github.com/bobrofon/easysshfs/issues/3#issuecomment-1944283039

Reverting back to Magisk 26.4 (26400) fixes this issue

Device: Moto Z Play Android version: LineageOS 18 Magisk version code: 27001

vvb2060 commented 7 months ago

su -mm enter magiskd's mount namespace (/proc/$(pidof magiskd)/ns/mnt). What mount namespace is your target? app (su), magiskd (su -mm), or init (su -t 1)? Who grep /proc/self/mounts ?

vvb2060 commented 7 months ago

https://github.com/topjohnwu/Magisk/blob/b04e1394c0dadbfd1314cc999f367a9a9781cfd8/native/src/core/daemon.cpp#L398-L399 magiskd mount namespace does not broadcast the mount point under /mnt. Sorry, we can't remove this line because old kernels get weirdly broken. I think using su -t 1 will work.

bobrofon commented 7 months ago

su -mm enter magiskd's mount namespace

It would be nice to have this information in the help message. Because right now it simply says Force run in the global mount namespace without an explanation what exactly global mount namespace means in this context.

What mount namespace is your target? app (su), magiskd (su -mm), or init (su -t 1)?

The target is any namespace mounting /mnt without mount-slave flag.

Who grep /proc/self/mounts ?

Just some random application process.

The main goal of using --master-mount option was to mimic SuperSu's --master-mount behavior. From SuperSu doc: '--master-mount' connects your app to a special su shell, which' mount commands are applied to all processes. If you need to 'publicly' apply a mount, use this option.

I think using su -t 1 will work.

Yes. It works.

magiskd mount namespace does not broadcast the mount point under /mnt

It looks like a breaking change and may affect a lot of fs-related applications (luckily there is only a small amount of them on Android). I would at least put this information in the release notes.

vvb2060 commented 7 months ago

It looks like a breaking change and may affect a lot of fs-related applications

I believe developers using this directory should be familiar with mount namespace, so they can simply use su -t pid. After #7685 merge I will test if sdcardfs works after removing this line.

It would be nice to have this information in the help message.

It's in the magisk app's su log tab, maybe it's too hidden?

bobrofon commented 7 months ago

It's in the magisk app's su log tab, maybe it's too hidden?

Now I see this message in the log tab. But yes, it may be a little tricky to find it.

yujincheng08 commented 7 months ago

https://github.com/bobrofon/easysshfs/pull/48