-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Problem description
Termux loses the ability to read any files after I use unshare and pivot_root to shell into a ubuntu chroot
Which somehow causes termux-x11 to crash and termux to not be able to open any new sessions than already open
Steps to reproduce the behavior.
On a device rooted with kernelSU, run (might work with magisk aswell)
# Setup a mini root for pivot_root
wget "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/aarch64/alpine-minirootfs-3.20.2-aarch64.tar.gz"
mkdir chroot
tar xvf "alpine-minirootfs-3.20.2-aarch64.tar.gz" -C chroot
# create a namespace and pivot_root into the chroot directory
su -c unshare -p -m -f sh -c \
"echo noop;\
mkdir -p chroot/old_root;\
mount --bind chroot chroot;\
busybox pivot_root chroot chroot/old_root;\
/bin/mount proc -t proc /proc;\
/bin/mount sys -t sysfs /sys;\
/bin/mount --bind /old_root/dev /dev;\
/bin/mount --bind /old_root/dev/pts /dev/pts;\
/bin/mount --bind /old_root/storage/emulated/0 /sdcard;\
/bin/mount --bind /old_root$PREFIX/tmp/ /tmp/;\
/bin/su -l"
Script for convenience
repro.sh.txt
What is the expected behavior?
No crash of termux-x11 and other termux proceeses
System information
- Termux application version: 0.119.0-beta.1
- Android OS version: 14 UKQ1.240716.001
- Device model: Xiaomi Pad 6 Running AOSPA