Skip to content

Commit 62e29fe

Browse files
aviraxptopjohnwu
authored andcommitted
Treat bind mount failure same as C++ implementation
This fixes #9139 and #9174.
1 parent e472db5 commit 62e29fe

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

native/src/core/module.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ macro_rules! module_log {
3131
#[allow(unused_variables)]
3232
fn bind_mount(reason: &str, src: &Utf8CStr, dest: &Utf8CStr, rec: bool) -> OsResultStatic<()> {
3333
module_log!(reason, dest, src);
34-
src.bind_mount_to(dest, rec)?;
35-
dest.remount_mount_point_flags(MS_RDONLY)?;
34+
// Ignore any kind of error here. If a single bind mount fails due to selinux permissions or
35+
// kernel limitations, don't let it break module mount entirely.
36+
src.bind_mount_to(dest, rec).log_ok();
37+
dest.remount_mount_point_flags(MS_RDONLY).log_ok();
3638
Ok(())
3739
}
3840

@@ -510,7 +512,7 @@ fn inject_zygisk_bins(system: &mut FsNode) {
510512
#[cfg(target_pointer_width = "32")]
511513
bin_path.append_path("magisk");
512514

513-
// There are some devices that announce ABI as 64 bit only, but ship with linker64
515+
// There are some devices that announce ABI as 64 bit only, but ship with linker
514516
// because they make use of a special 32 bit to 64 bit translator (such as tango).
515517
// In this case, magisk32 does not exist, so inserting it will cause bind mount
516518
// failure and affect module mount. Native bridge injection does not support these

0 commit comments

Comments
 (0)