From b80e06256d55e153cd4a642432dff8aa191591cc Mon Sep 17 00:00:00 2001 From: tiann Date: Tue, 16 May 2023 22:27:01 +0800 Subject: [PATCH] Revert "Add option to enable global namespace (#497)" This reverts commit f81caf75a96b98684fafc701baa17484e5babd96. --- kernel/ksu.c | 4 ---- userspace/ksud/src/ksu.rs | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/kernel/ksu.c b/kernel/ksu.c index 29e52748..a507665b 100644 --- a/kernel/ksu.c +++ b/kernel/ksu.c @@ -1,6 +1,5 @@ #include "linux/fs.h" #include "linux/module.h" -#include "linux/moduleparam.h" #include "linux/workqueue.h" #include "allowlist.h" @@ -10,9 +9,6 @@ #include "ksu.h" #include "uid_observer.h" -int global_namespace_enable; -module_param(global_namespace_enable, int, S_IRUSR | S_IWUSR); - static struct workqueue_struct *ksu_workqueue; bool ksu_queue_work(struct work_struct *work) diff --git a/userspace/ksud/src/ksu.rs b/userspace/ksud/src/ksu.rs index 062b2a90..801df321 100644 --- a/userspace/ksud/src/ksu.rs +++ b/userspace/ksud/src/ksu.rs @@ -229,10 +229,7 @@ pub fn root_shell() -> Result<()> { // switch to global mount namespace #[cfg(any(target_os = "linux", target_os = "android"))] - let global_namespace_enable = - std::fs::read_to_string("/sys/module/ksu/parameters/global_namespace_enable") - .unwrap_or("0".to_string()); - if global_namespace_enable.trim() == "1" || mount_master { + if mount_master { let _ = utils::switch_mnt_ns(1); let _ = utils::unshare_mnt_ns(); }