Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/system/bin/su: No such file or directory #1813

Closed
3 tasks done
shandongtlb opened this issue Jun 8, 2024 · 18 comments
Closed
3 tasks done

/system/bin/su: No such file or directory #1813

shandongtlb opened this issue Jun 8, 2024 · 18 comments

Comments

@shandongtlb
Copy link

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • I will upload bugreport file in KernelSU Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

Screenshot_20240609_000358_NetHunter Terminal
之前还好好的,更新了1.0之后就这样了,dmesg没发现异常
其他终端类app均提示无su,使用mt浏览器也未发现有su
内核官网gki模式,自编译gki以及lkm模式均复现

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Logs

No response

Device info

  • Device: s23u
  • OS Version: oneui5.1
  • KernelSU Version: 1.0
  • Kernel Version: 5.15.78 gki

Additional context

No response

@tiann
Copy link
Owner

tiann commented Jun 9, 2024

你装的是不是 32 位的应用

@shandongtlb
Copy link
Author

貌似是system挂载只读导致的,可是刷了读写模块还不行

@shandongtlb
Copy link
Author

你装的是不是 32 位的应用

你指的是ksu的APP32位吗,貌似只有64一个版本
其他终端类都是64的

@shandongtlb
Copy link
Author

你装的是不是 32 位的应用

我专门看了一下,就算模块已经挂载读写,/system/bin/里面也没有su

@tiann
Copy link
Owner

tiann commented Jun 9, 2024

su 文件本来就不存在。你直接运行 /system/bin/su 是什么结果?

@shandongtlb
Copy link
Author

su 文件本来就不存在。你直接运行 /system/bin/su 是什么结果?

Screenshot_20240609_112707_NetHunter Terminal

not found

@shandongtlb
Copy link
Author

换了几个APP,都一样的结果

@shandongtlb
Copy link
Author

juicessh和termux 都不行
Screenshot_20240609_113825_Termux

@fsxitutu
Copy link
Contributor

juicessh和termux 都不行 Screenshot_20240609_113825_Termux

如果你是使用termux的google play版本,请换回f-droid版本。实测google play版本在termux环境内无法识别kernelsu的su命令(failsafe环境可使用su)。

@shandongtlb
Copy link
Author

juicessh和termux 都不行 Screenshot_20240609_113825_Termux

如果你是使用termux的google play版本,请换回f-droid版本。实测google play版本在termux环境内无法识别kernelsu的su命令(failsafe环境可使用su)。

可是我得用nethunter的终端,不行,现在换回magisk了,先将就着

@5ec1cff
Copy link
Contributor

5ec1cff commented Jun 13, 2024

如果还想在用 ksu 的情况下正常使用 play 版 termux ,可以把你的 su 脚本 ($PREFIX/bin/su) 换成下面的代码

if [ -n "$LD_PRELOAD" ]; then
 unset LD_PRELOAD LD_LIBRARY_PATH
 exec /system/bin/sh $0 "$@"
fi
exec /system/bin/su "$@"

@bgaojin
Copy link

bgaojin commented Jun 14, 2024

我遇到的问题 设置shell root以后,linux(5.15.0-107-generic)下打开终端 adb shell 输入su 提示/system/bin/su: 没有那个文件或目录
用的0.9.5版本,手机内核4.4 自己编译,其他app root正常。之前使用的是0.7.6版本 功能正常,升级0.9.5以后遇到这个问题,代码申请su一切正常

@aviraxp
Copy link
Contributor

aviraxp commented Jun 15, 2024

如果还想在用 ksu 的情况下正常使用 play 版 termux ,可以把你的 su 脚本 ($PREFIX/bin/su) 换成下面的代码

if [ -n "$LD_PRELOAD" ]; then
 unset LD_PRELOAD LD_LIBRARY_PATH
 exec /system/bin/sh $0 "$@"
fi
exec /system/bin/su "$@"

termux-play-store/termux-tools@9187cfa

@kongle233
Copy link

我也遇见了同样的问题,经过我的测试,内核ksu版本大于等于9.4就会出现这个问题,目前尚未解决

@hamjin
Copy link

hamjin commented Jun 27, 2024

ssh-iSowUqgFMj6LkxsGWZ7iCA==/lib/arm64/libcom_sonelli_bash.so -c su --help 2>&1 | grep su                             <
execve("/data/app/~~1_FVbQm4Aqq2x6NeV25AuQ==/com.sonelli.juicessh-iSowUqgFMj6LkxsGWZ7iCA==/lib/arm64/libcom_sonelli_bash.so", ["/data/app/~~1_FVbQm4Aqq2x6NeV25A"..., "-c", "su", "--help"], 0x7feebc97c8 /* 26 vars */strace: [ Process PID=19422 runs in 32 bit mode. ]
strace: WARNING: Proper structure decoding for this personality is not supported, please consider building strace with mpers support enabled.
fstatat64(AT_FDCWD, "/system/etc/ld.config.arm.txt", 0xfff2cad8, 0) = -1 ENOENT (No such file or directory)
read(3, "oid.hardware.confirmationui-supp"..., 4096) = 4096
faccessat(AT_FDCWD, "/data/nativetest/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest64/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest64/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest64/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest64/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest/unrestricted", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest64/unrestricted", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/local/tmp/isolated", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/product/lib/vndk-sp", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/product/lib/vndk-sp", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/odm/lib/vndk-sp", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/odm/lib/vndk-sp", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/vendor/lib/vndk-sp", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/vendor/lib/vndk-sp", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.resolv/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.resolv/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.appsearch/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.appsearch/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.uwb/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.uwb/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.adservices/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.adservices/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.virt/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.virt/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.extservices/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.extservices/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/product/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.runtime/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.art/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/system_ext/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/system/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/system/xbin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/odm/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/vendor/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/vendor/xbin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
write(2, "--help: su: command not found\n", 30--help: su: command not found

JuiceSSH(com.sonelli.juicessh) version 3.2.2(Google Play Store) 看上去不会直接execve
edit: commit 815f4d0 可能漏hook了fstatat64?
edit2: hook点newfstatat 换成vfs_fstat(at)看上去会更好?这两个函数都在linux/fs.h里面且不是static。
https://elixir.bootlin.com/linux/v5.10.210/source/include/linux/fs.h#L3180
https://elixir.bootlin.com/linux/v5.15.157/source/include/linux/fs.h#L3377
https://elixir.bootlin.com/linux/v6.1.87/source/include/linux/fs.h#L3360
https://elixir.bootlin.com/linux/v6.6.35/source/include/linux/fs.h#L3097

@shandongtlb
Copy link
Author

ssh-iSowUqgFMj6LkxsGWZ7iCA==/lib/arm64/libcom_sonelli_bash.so -c su --help 2>&1 | grep su                             <
execve("/data/app/~~1_FVbQm4Aqq2x6NeV25AuQ==/com.sonelli.juicessh-iSowUqgFMj6LkxsGWZ7iCA==/lib/arm64/libcom_sonelli_bash.so", ["/data/app/~~1_FVbQm4Aqq2x6NeV25A"..., "-c", "su", "--help"], 0x7feebc97c8 /* 26 vars */strace: [ Process PID=19422 runs in 32 bit mode. ]
strace: WARNING: Proper structure decoding for this personality is not supported, please consider building strace with mpers support enabled.
fstatat64(AT_FDCWD, "/system/etc/ld.config.arm.txt", 0xfff2cad8, 0) = -1 ENOENT (No such file or directory)
read(3, "oid.hardware.confirmationui-supp"..., 4096) = 4096
faccessat(AT_FDCWD, "/data/nativetest/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest64/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest64/odm", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest64/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/benchmarktest64/vendor", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest/unrestricted", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/nativetest64/unrestricted", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/data/local/tmp/isolated", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/product/lib/vndk-sp", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/product/lib/vndk-sp", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/odm/lib/vndk-sp", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/odm/lib/vndk-sp", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/vendor/lib/vndk-sp", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/vendor/lib/vndk-sp", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.resolv/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.resolv/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.appsearch/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.appsearch/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.uwb/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.uwb/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.adservices/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.adservices/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.virt/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.virt/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/apex/com.android.extservices/lib", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.extservices/lib", 0xfff2a820, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/product/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.runtime/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/apex/com.android.art/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/system_ext/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/system/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/system/xbin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/odm/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/vendor/bin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
fstatat64(AT_FDCWD, "/vendor/xbin/su", 0xfff2eac8, 0) = -1 ENOENT (No such file or directory)
write(2, "--help: su: command not found\n", 30--help: su: command not found

JuiceSSH(com.sonelli.juicessh) version 3.2.2(Google Play Store) 看上去不会直接execve edit: commit 815f4d0 可能漏hook了fstatat64? edit2: hook点newfstatat 换成vfs_fstat(at)看上去会更好?这两个函数都在linux/fs.h里面且不是static。 https://elixir.bootlin.com/linux/v5.10.210/source/include/linux/fs.h#L3180 https://elixir.bootlin.com/linux/v5.15.157/source/include/linux/fs.h#L3377 https://elixir.bootlin.com/linux/v6.1.87/source/include/linux/fs.h#L3360 https://elixir.bootlin.com/linux/v6.6.35/source/include/linux/fs.h#L3097

你才是真大佬

@a289672082
Copy link

负更新吗,还好我翻了记录,对非gki设备影响很大,因为官方对非gki设备的指导版本是0.95

@heinhuiz
Copy link

This issue starts on 0.9.3, so 0.9.2 is the latest usable version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants