KernelSU icon indicating copy to clipboard operation
KernelSU copied to clipboard

Add mount namespace support 添加挂载命名空间支持

Open u9521 opened this issue 3 weeks ago • 2 comments

tested on nx769j android14-6.1 kernel , terminal app is termux

inherit mode

kerenlsu default behavior

global mode

~ $ ls -l /proc/self/ns/ | sed -E 's/.*[0-9]{2}:[0-9]{2} //g'
total 0
cgroup -> cgroup:[4026531835]
mnt -> mnt:[4026535508]
net -> net:[4026531840]
time -> time:[4026531834]
time_for_children -> time:[4026531834]
uts -> uts:[4026531838]
~ $ su
:/ # ls -l /proc/self/ns/ | sed -E 's/.*[0-9]{2}:[0-9]{2} //g'
total 0
cgroup -> cgroup:[4026531835]
mnt -> mnt:[4026532634]
net -> net:[4026531840]
time -> time:[4026531834]
time_for_children -> time:[4026531834]
uts -> uts:[4026531838]
:/ # ls -l /proc/1/ns/ | sed -E 's/.*[0-9]{2}:[0-9]{2} //g'
total 0
cgroup -> cgroup:[4026531835]
mnt -> mnt:[4026532634]
net -> net:[4026531840]
time -> time:[4026531834]
time_for_children -> time:[4026531834]
uts -> uts:[4026531838]
:/ # mount -t debugfs none /sys/kernel/debug
now we can see /d/ mount on every process
:/ # umount /sys/kernel/debug

independent mode

~ $  ls -l /proc/self/ns/ | sed -E 's/.*[0-9]{2}:[0-9]{2} //g'
total 0
cgroup -> cgroup:[4026531835]
mnt -> mnt:[4026535510]
net -> net:[4026531840]
time -> time:[4026531834]
time_for_children -> time:[4026531834]
uts -> uts:[4026531838]
~ $ su
# ls -l /proc/self/ns/ | sed -E 's/.*[0-9]{2}:[0-9]{2} //g'
total 0
cgroup -> cgroup:[4026531835]
mnt -> mnt:[4026535516]
net -> net:[4026531840]
time -> time:[4026531834]
time_for_children -> time:[4026531834]
uts -> uts:[4026531838]
ls -l /proc/1/ns/ | sed -E 's/.*[0-9]{2}:[0-9]{2} //g'
total 0
cgroup -> cgroup:[4026531835]
mnt -> mnt:[4026532634]
net -> net:[4026531840]
time -> time:[4026531834]
time_for_children -> time:[4026531834]
uts -> uts:[4026531838]
~ $ su
:/data/data/com.termux/files/home # mount -t debugfs none /sys/kernel/debug
:/data/data/com.termux/files/home # ls /sys/kernel/debug
88e3000.hsphy
......
:/data/data/com.termux/files/home # ^D
~ $ ls -l /sys/kernel/debug/
total 0
~ $

u9521 avatar Nov 10 '25 13:11 u9521