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

Can't start ksu safe mode. 无法进入KSU安全模式 #1185

Closed
3 tasks done
iiiiuuu opened this issue Dec 2, 2023 · 16 comments
Closed
3 tasks done

Can't start ksu safe mode. 无法进入KSU安全模式 #1185

iiiiuuu opened this issue Dec 2, 2023 · 16 comments

Comments

@iiiiuuu
Copy link

iiiiuuu commented Dec 2, 2023

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

在某次授权异常或应用卸载后,手机卡死,重启后系统无限卡第一屏,同时ksu无法进入安全模式。

  1. boot官方内核可以正常启动。
  2. boot gki内核(不含ksu)可以启动。
  3. boot gki+ksu内核无法启动。
  4. boot magisk的boot.img可以启动。

After a authorization exception or a plugin exception, the system is stuck on the first screen indefinitely, while ksu can't enter safe mode.

  1. boot official kernel can boot normally.
  2. boot gki kernel without ksu can boot.
  3. boot gki kernel with ksu cannot boot.
  4. boot magisk boot.img can boot.

To Reproduce

尝试修改ksu_is_safe_modeis_safe_mode函数,使其强制返回true,问题依旧。

Tried modifying the ksu_is_safe_mode and is_safe_mode functions to force them to return true, the problem remains.

Expected behavior

No response

Screenshots

No response

Logs

last_kmsg.txt

[   11.104988][  T251] CPU: 6 PID: 251 Comm: kworker/u16:4 Tainted: G S      WC OE      6.1.57-android14-11-leijun-jinfan #1
[   11.104991][  T251] Hardware name: Qualcomm Technologies, Inc. Houji based on SM8650 (DT)
[   11.104993][  T251] Workqueue: kernelsu_work_queue do_update_uid
[   11.105004][  T251] pstate: 22400005 (nzCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
[   11.105007][  T251] pc : ksu_prune_allowlist+0x19c/0x1a4
[   11.105011][  T251] lr : ksu_prune_allowlist+0xd0/0x1a4
[   11.105014][  T251] sp : ffffffc008eabbf0
[   11.105015][  T251] x29: ffffffc008eabbf0 x28: 000000000000270f x27: 0000000000000000
[   11.105018][  T251] x26: ffffff8801a40400 x25: ffffffe586a89950 x24: ffffff8801a41014
[   11.105020][  T251] x23: 0000000005f482d2 x22: ffffff8801a41000 x21: dead000000000122
[   11.105022][  T251] x20: ffffffe585482adc x19: ffffffc008eabc80 x18: ffffffe586831170
[   11.105024][  T251] x17: ffffffffffffffff x16: 0000000000000000 x15: 0000000000000004
[   11.105026][  T251] x14: ffffff8b6ba10000 x13: 0000000000000003 x12: 0000000000000003
[   11.105028][  T251] x11: 00000000fffeffff x10: ffffffe58684e5d8 x9 : ffffff8801a40400
[   11.105030][  T251] x8 : dead000000000100 x7 : 20656e757270203a x6 : 55536c656e72654b
[   11.105033][  T251] x5 : ffffffe586a2a763 x4 : ffffff8b6c17bf83 x3 : ffffff8801a40400
[   11.105035][  T251] x2 : ffffff8801a41000 x1 : ffffff8801a41000 x0 : 0000000000000001
[   11.105037][  T251] Call trace:
[   11.105038][  T251]  ksu_prune_allowlist+0x19c/0x1a4
[   11.105041][  T251]  do_update_uid+0x208/0x2d8
[   11.105044][  T251]  process_one_work+0x240/0x504
[   11.105053][  T251]  worker_thread+0x264/0x480
[   11.105056][  T251]  kthread+0x10c/0x154
[   11.105062][  T251]  ret_from_fork+0x10/0x20
[   11.105066][  T251] Code: a9416ffc a8c67bfd d50323bf d65f03c0 (d42aa240) 
[   11.105068][  T251] ---[ end trace 0000000000000000 ]---
[   11.105070][  T251] Kernel panic - not syncing: BRK handler: Fatal exception
[   11.105071][  T251] SMP: stopping secondary CPUs

Device info

Additional context

No response

@iiiiuuu
Copy link
Author

iiiiuuu commented Dec 2, 2023

可以通过
return at begin ksu_prune_allowlist
return trueksu_is_safe_modeis_safe_mode函数
缓解这个问题。

void ksu_prune_allowlist(bool (*is_uid_valid)(uid_t, char *, void *), void *data)
{
        return;

ditry fix: force return ksu_prune_allowlist and return true (ksu_is_safe_mode, is_safe_mode) can solve this problem.

@tiann
Copy link
Owner

tiann commented Dec 4, 2023

能否传一份 bugreport,或者把 /data/adb/ksu/.allowlist 传上来?

@Mr54233
Copy link

Mr54233 commented Dec 12, 2023

除了清除数据还有什么办法能进入系统么,官方rec内没看到安全模式的选项。并且我换回官方boot依旧卡在开机动画,无法进入系统

@neooier
Copy link

neooier commented Dec 26, 2023

能否传一份 bugreport,或者把 /data/adb/ksu/.allowlist 传上来?

我遇到了相同问题,这里是我的 .allowlist 和 log

ksu.zip

我目前仍在尝试通过ksu进入系统,但都不起作用,希望能尽快得到帮助,感谢您的付出!

@neooier
Copy link

neooier commented Dec 26, 2023

我尝试了删除.allowlist,删除ksu文件夹,删除adb文件夹,但是都不起作用

@tiann
Copy link
Owner

tiann commented Dec 26, 2023

在进入这个状态之前,你做了什么操作?

@neooier
Copy link

neooier commented Dec 26, 2023

在进入这个状态之前,你做了什么操作?

卸载acc(Advanced Charging Controller)并重启

在尝试删除.allowlist之前,我已经通过正常的boot.img进入系统,使用miui的下载最新完整包进行了一次系统更新

@tiann
Copy link
Owner

tiann commented Dec 26, 2023

用 miui 的完整包刷完还重启?

@neooier
Copy link

neooier commented Dec 26, 2023

我进行了重启,然后尝试通过刷入kernelsu恢复root

我对这些操作的了解并不深入,也许这看起来很蠢,但是我为了不用折腾我的个人数据确实这么做了😖

@tiann
Copy link
Owner

tiann commented Dec 26, 2023

你刷完整版是为了更新系统?你可能需要使用新的 ,ksu image 或者用 magiskboot 打包

@neooier
Copy link

neooier commented Dec 26, 2023

我刷完整包是因为kernelsu无法启动同时无法进入安全模式,在尝试刷入原版boot.img并成功启动后,考虑到可能是acc改动了系统的配置文件导致的重启,所以我决定进行一次完整更新以修复可能的问题。

我确定我使用了适用于更新后的miui的ksu image,我同时尝试了从fastboot刷入以及从twrp刷入anykernel

MIUI版本:14.0.5 14.0.5.0(UMCCNXM)
内核版本:5.15.78

@neooier
Copy link

neooier commented Dec 27, 2023

值得补充的一点是,由于我本身的系统已经是最新版,所以更新后内核并没有任何变化

@tiann
Copy link
Owner

tiann commented Dec 27, 2023

我刷完整包是因为kernelsu无法启动同时无法进入安全模式,在尝试刷入原版boot.img并成功启动后,考虑到可能是acc改动了系统的配置文件导致的重启,所以我决定进行一次完整更新以修复可能的问题。

我确定我使用了适用于更新后的miui的ksu image,我同时尝试了从fastboot刷入以及从twrp刷入anykernel

MIUI版本:14.0.5 14.0.5.0(UMCCNXM) 内核版本:5.15.78

你完整包的安全补丁级别是多少?刷的 ksu 用的具体是哪个版本?

PS:另开一个 issue 吧,跟这个 issue 的问题无关。

@neooier
Copy link

neooier commented Dec 27, 2023

我进入twrp删除了 /data/adb 以及 /data/data/me.weishu.kernelsu 文件夹后 kernelsu 成功启动了,感谢您的帮助

@tiann
Copy link
Owner

tiann commented Dec 27, 2023

已尝试修复:fe7f509

但由于现场已经丢失,不一定保证找到了根因,如果问题依然复现,欢迎 reopen。

@tiann tiann closed this as completed Dec 27, 2023
@tiann
Copy link
Owner

tiann commented Dec 27, 2023

#1227 类似问题

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

4 participants