From 9292219749bde1df1321d3a9cebe0dfa05285e28 Mon Sep 17 00:00:00 2001 From: xiangfeidexiaohuo Date: Sat, 30 Dec 2023 02:09:11 +0800 Subject: [PATCH] Revert "Mount temp dir at /debug_ramdisk (#1226)" This reverts commit 706cd1e73e1e022dbf42929acaaf27f7170487f9. Signed-off-by: xiangfeidexiaohuo --- kernel/core_hook.c | 1 - userspace/ksud/src/defs.rs | 1 - userspace/ksud/src/mount.rs | 31 ------------------------------- 3 files changed, 33 deletions(-) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index 45696919a0c8..d1f4d5b07131 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -593,7 +593,6 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old) try_umount("/data/adb/modules", false, MNT_DETACH); // try umount ksu temp path - try_umount("/debug_ramdisk", false, MNT_DETACH); try_umount("/sbin", false, MNT_DETACH); return 0; diff --git a/userspace/ksud/src/defs.rs b/userspace/ksud/src/defs.rs index 9508f562955b..5d85709a0932 100644 --- a/userspace/ksud/src/defs.rs +++ b/userspace/ksud/src/defs.rs @@ -27,7 +27,6 @@ pub const MODULE_UPDATE_TMP_DIR: &str = concatcp!(ADB_DIR, "modules_update/"); pub const SYSTEM_RW_DIR: &str = concatcp!(MODULE_DIR, ".rw/"); -pub const TEMP_DIR: &str = "/debug_ramdisk"; pub const TEMP_DIR_LEGACY: &str = "/sbin"; pub const MODULE_WEB_DIR: &str = "webroot"; diff --git a/userspace/ksud/src/mount.rs b/userspace/ksud/src/mount.rs index a7f34837f446..a956b650040f 100644 --- a/userspace/ksud/src/mount.rs +++ b/userspace/ksud/src/mount.rs @@ -151,33 +151,7 @@ pub fn mount_overlayfs( } #[cfg(any(target_os = "linux", target_os = "android"))] -pub fn mount_tmpfs(dest: impl AsRef) -> Result<()> { - info!("mount tmpfs on {}", dest.as_ref().display()); - if let Result::Ok(fs) = fsopen("tmpfs", FsOpenFlags::FSOPEN_CLOEXEC) { - let fs = fs.as_fd(); - fsconfig_set_string(fs, "source", KSU_OVERLAY_SOURCE)?; - fsconfig_create(fs)?; - let mount = fsmount(fs, FsMountFlags::FSMOUNT_CLOEXEC, MountAttrFlags::empty())?; - move_mount( - mount.as_fd(), - "", - CWD, - dest.as_ref(), - MoveMountFlags::MOVE_MOUNT_F_EMPTY_PATH, - )?; - } else { - mount( - KSU_OVERLAY_SOURCE, - dest.as_ref(), - "tmpfs", - MountFlags::empty(), - "", - )?; - } - Ok(()) -} -#[cfg(any(target_os = "linux", target_os = "android"))] pub fn bind_mount(from: impl AsRef, to: impl AsRef) -> Result<()> { info!( "bind mount {} -> {}", @@ -316,8 +290,3 @@ pub fn mount_overlay( ) -> Result<()> { unimplemented!() } - -#[cfg(not(any(target_os = "linux", target_os = "android")))] -pub fn mount_tmpfs(_dest: impl AsRef) -> Result<()> { - unimplemented!() -}