tiann / KernelSU

A Kernel based root solution for Android
https://kernelsu.org
GNU General Public License v3.0
9.98k stars 1.62k forks source link

Failed to mount overlayfs with Motorola Kernel (5.4.233) #1187

Closed Garry050 closed 10 months ago

Garry050 commented 10 months ago

Please check before submitting an issue

Describe the bug

Failed overlayfs mount due Motorola/FeliCa restrict?

https://github.com/MotorolaMobilityLLC/kernel-msm/blob/56e5d5098bfd321364b97ff8473562ec7fc0410c/fs/namespace.c#L3099

Applied patch https://github.com/sticpaper/android_kernel_xiaomi_msm8998-ksu/commit/646d0c836053ffa8743519c39fcabaecb258f00b https://github.com/wxt1221/KernelSU/commit/ae8a14e708e2ee859912218d70623ee08a80b762 https://github.com/wxt1221/KernelSU/commit/194e09fcf11a001dab285837620ce66351fb9cf2 https://github.com/wxt1221/KernelSU/commit/5574642b20b0f7780fa9a2e3643eb8f99141bd68 https://github.com/wxt1221/KernelSU/commit/fce6f6ed6ed649df51ab468c57b9ff698fcb2701 https://github.com/sticpaper/android_kernel_xiaomi_msm8998-ksu/commit/646d0c836053ffa8743519c39fcabaecb258f00b

To Reproduce

  1. Building Kernel with KernelSU Integration+cypfr defconfig (Moto Stock+Moto Kernel need KPROBES to bootup)
  2. Flash Kernel and Install KernelSU
  3. Install any systemless modules

Expected behavior

overlayfs should success mount to /system or /product etc etc (depends module)

Screenshots

No response

Logs

KernelSU_bugreport_2023-12-04_04_00.tar.zip (there is 2 tar file in zip)

Device info

Additional context

It looks like #489 issues. So i did before post issue

  1. Removed CONFIG_FELICA_MOUNT_BLOCK from defconfig --- It works but NFC/FeliCa died.
  2. change if (flags & MS_REMOUNT) to if (flags & MS_RDONLY) from fs/namespace.c --- It works but same. NFC/FeliCa died.
  3. change .flags(MountFlags::RDONLY) to .flags(MountFlags::REMOUNT) from KernelSU/userspace/ksud/src/mount.rs --- Failed. mount: '/system' not in /proc/mounts

But Magisk module works fine. I can't track anymore.

Garry050 commented 10 months ago

Ah. I was so stupid. I forget check about "Unmount modules by default". Not related about anything, modules conflicting something to NFC and others.