Skip to content

Conversation

@ShirkNeko
Copy link
Contributor

@ShirkNeko ShirkNeko commented Sep 15, 2025

  • 获取活跃用户UserID列表
  • 通过 /data/user_de/{userid}/[package] 解析对应用户应用的UID
  • 弃用通过不稳定的 packages.list 获取

ShirkNeko and others added 9 commits September 12, 2025 04:14
…[app] directory

Prioritize retrieving the application UID from /data/user_de. If this fails, fall back to retrieving it from packages.list.

Fix unstable application UID acquisition

Signed-off-by: ShirkNeko <[email protected]>
Enhance scan support for active users in /data/user_de

Signed-off-by: ShirkNeko <[email protected]>
- Remove the deprecated USER_DATA_LEGACY_BASE_PATH path

-Increase the size of USER_DATA_PATH_LEN to 384
@ShirkNeko ShirkNeko changed the title 内核:通过解析 /data/user_de/ 中的 UID 来添加真实的 UID Kernel: Add the actual UID by parsing the UID in /data/user_de/ Sep 15, 2025
@ShirkNeko
Copy link
Contributor Author

ShirkNeko commented Sep 15, 2025

提交 efb0c44 以后,为多用户扫描添加可选开关

  • 默认始终只扫描主用户的应用UID
  • 在管理器设置中添加 扫描所有用户 开关(默认为关闭)
  • 打开 扫描所有用户开关 将扫描 /data/user_de 以获取所有用户并扫描所有多用户应用 UID

@aviraxp
Copy link
Collaborator

aviraxp commented Sep 15, 2025

建议不添加开关,刚看了下,全部扫一个用户的所有应用其实几十毫秒就能完成,没必要增加复杂性

@ShirkNeko
Copy link
Contributor Author

建议不添加开关,刚看了下,全部扫一个用户的所有应用其实几十毫秒就能完成,没必要增加复杂性

看术哥怎么说吧,对于内核来说确实越小的开销越好

@tiann
Copy link
Owner

tiann commented Sep 16, 2025

我也不建议加开关。之前 comment 里面的 Optional 指的是对开发者而言的,如果想做可以加上,不想做就不做;并非把这个选择权给用户,用户看到这个开关可能会很懵逼。

@ShirkNeko
Copy link
Contributor Author

我也不建议加开关。之前 comment 里面的 Optional 指的是对开发者而言的,如果想做可以加上,不想做就不做;并非把这个选择权给用户,用户看到这个开关可能会很懵逼。

好的

- Use a cached buffer as an array-based stack to avoid panics caused by overly deep traversal.

  INTCAM: no information
       TPU: no information
       TNR: no information
       MFC: no information
        BO: no information
[   4.715484] [I] [DSS] Last AVB: avb_ret=ERROR_VERIFICATION
[   4.715890] [I] [DSS] Last AVB: avb_veritymode=enforcing
[   4.716289] [I] [DSS] Last AVB: avb_error_parts=boot
[   4.717085] [I] [LNXDBG] build info set by kernel
RAMDUMP_MSG.txt:
  reset message: KP: kernel stack overflow
  UUID: e2faff80-83ea-c240-ac75-d7b8a528c892
  last kernel version: 6.1.134-android14-11-g23e556daebf3-ab13800907
  aosp kernel version: 6.1.145-android14-11-g8d713f9e8e7b-ab13202960
  build: google/shiba/shiba:16/BP3A.250905.014/13873947:user/release-keys
  RST_STAT: 0x1 - CLUSTER0_NONCPU_WDTRESET
  GSA_RESET_STATUS: 0x0 -
  Reboot reason: 0xbaba - Kernel PANIC
  Reboot mode: 0x0 - Normal Boot
[   4.719030] [I] [DSS] -------------------- DSS LOGS END --------------------

Reboot Info:
  RST_STAT: 0x180000 - PIN_RESET | PO_RESET
  GSA_RESET_STATUS: 0x0 -
  Reboot reason: 0xbaba - Kernel PANIC
  Reboot mode: 0x0 - Normal Boot

Signed-off-by: ShirkNeko <[email protected]>
`[   23.379244][ T5074] ufshcd-qcom 1d84000.ufshc: ............. ufs dump complete ..........
[   23.379263][ T5074] dump-reason-buffer-size: 256
[   23.379267][ T5074] dump-reason-pidbuffer:PID: 5074, Process Name: throne_tracker
[   23.379295][ T5074] qcom_q6v5_pas a3380000.remoteproc-soccp: waking SOCCP from panic path
[   23.379455][ T5074] CPU0 next event is 23368000000
[   23.379456][ T5074] CP.rkp_only' to 'true' in property file '/odm/build.prop': SELinux permission check failed
[    1.248057][    T1] init: Do not have permissions to set 'ro.oplus.nfc.support.tee' to 'true' in pro   23.379459][ T5074] CPU5 next event is 23368000000
[   23.3794   1.248059][    T1] init: Do not have permissions to set 'ro.oplus.eid.enable.state' to '1' in property file '/odm/build.prop':l-3d0: snapshot: device is powered off
[   23.589323][ T5074] Kernel Offset: 0x1738a00000 from 0xffffffc080000000
[   23.589325][ T5074] PHYS_OFFSET: 0x80000000
[   23.589326][ T5074] CPU features: 0x000000,00000000,70024f43,95fffea7
[   23.589328][ T5074] Memory Limit: none
[   23.589490][ T5074] mhi mhi_110e_00.01.00: [E][mhi_debug_reg_dump] host pm_state:M2 dev_state:M2 ee:MISSION MODE
[   23.589505][ T5074] mhi mhi_110e_00.01.00: [E][mhi_debug_reg_dump] device ee: MISSION MODE dev_state: M2`

Signed-off-by: ShirkNeko <[email protected]>
@ShirkNeko
Copy link
Contributor Author

我觉得直接在内核中直接遍历/data是否会导致部分机型在解析时如果遇到了加密或挂载状态有概率会导致内核死锁

@ShirkNeko
Copy link
Contributor Author

因为它是一个动态目录,而不是像packages.list一样是一个静态文件

backslashxx added a commit to ximi-mojito-test/mojito_krenol that referenced this pull request Sep 16, 2025
move to always kthreaded and mitigate sporadic deadlocks on

ref
tiann/KernelSU#2757
tiann/KernelSU#2759
@ShirkNeko
Copy link
Contributor Author

ShirkNeko commented Sep 16, 2025

@aviraxp
Copy link
Collaborator

aviraxp commented Sep 17, 2025

这些fs magic是怎么选的

rsuntk added a commit to rsuntk/KernelSU that referenced this pull request Sep 27, 2025
…nnecessary info

* tiann#2759
Introduce /data/user_de/0 scanning, however upon testing, we got a lot of dmesg log spam
about scanned packages.

<timestamp> KernelSU: Found package: com.android.vending, uid: 10372

This reduce the unused dmesg bloating.

Signed-off-by: rsuntk <[email protected]>
…nnecessary info

* tiann tiann#2759
Introduce /data/user_de/0 scanning, however upon testing, we got a lot of dmesg log spam
about scanned packages.

<timestamp> KernelSU: Found package: com.android.vending, uid: 10372

This reduce the unused dmesg bloating.

Co-authored-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
Signed-off-by: ShirkNeko <[email protected]>
rsuntk added a commit to rsuntk/KernelSU that referenced this pull request Sep 27, 2025
* Based on tiann#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
luyanci pushed a commit to luyanci/KernelSU that referenced this pull request Sep 27, 2025
* Based on tiann#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
rifsxd pushed a commit to KernelSU-Next/KernelSU-Next that referenced this pull request Sep 30, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!
- Added self-healing lock mechanism:
  * Reset scan_lock if /data/user_de/0 scan fails
  * Reset pkg_lock if /data/user_de/0 scan later succeeds
  * Always prefers /data/user_de/0 when accessible
  * Prevents lock from becoming stuck forever

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
rifsxd added a commit to KernelSU-Next/KernelSU-Next that referenced this pull request Sep 30, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!
- Added self-healing lock mechanism:
  * Reset scan_lock if /data/user_de/0 scan fails
  * Reset pkg_lock if /data/user_de/0 scan later succeeds
  * Always prefers /data/user_de/0 when accessible
  * Prevents lock from becoming stuck forever

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
Co-authored-by: rifsxd <[email protected]>
rifsxd added a commit to KernelSU-Next/KernelSU-Next that referenced this pull request Sep 30, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!
- Added self-healing lock mechanism:
  * Reset scan_lock if /data/user_de/0 scan fails
  * Reset pkg_lock if /data/user_de/0 scan later succeeds
  * Always prefers /data/user_de/0 when accessible
  * Prevents lock from becoming stuck forever

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
Co-authored-by: rifsxd <[email protected]>
rifsxd added a commit to KernelSU-Next/KernelSU-Next that referenced this pull request Sep 30, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!
- Added self-healing lock mechanism:
  * Reset scan_lock if /data/user_de/0 scan fails
  * Reset pkg_lock if /data/user_de/0 scan later succeeds
  * Always prefers /data/user_de/0 when accessible
  * Prevents lock from becoming stuck forever

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
Co-authored-by: rifsxd <[email protected]>
rifsxd pushed a commit to KernelSU-Next/KernelSU-Next that referenced this pull request Sep 30, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
AzyrRuthless pushed a commit to AzyrRuthless/KernelSU-Next that referenced this pull request Sep 30, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>

kernel: handle throned UID change if manager is reinstall or changed

drop old UID and throne the new one when the manager is reinstalled or changed
E85Addict pushed a commit to E85Addict/KernelSU-Next that referenced this pull request Oct 1, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!
- Added self-healing lock mechanism:
  * Reset scan_lock if /data/user_de/0 scan fails
  * Reset pkg_lock if /data/user_de/0 scan later succeeds
  * Always prefers /data/user_de/0 when accessible
  * Prevents lock from becoming stuck forever

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
Co-authored-by: rifsxd <[email protected]>
LeCmnGend pushed a commit to LeCmnGend/KernelSU that referenced this pull request Oct 1, 2025
* Based on tiann#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
re-noroi pushed a commit to re-noroi/KernelSU-Next that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
re-noroi pushed a commit to re-noroi/KernelSU-Next that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
re-noroi pushed a commit to re-noroi/KernelSU-Next that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
ramabondanp pushed a commit to ramabondanp/KernelSU-Next that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
Signed-off-by: Rama Bondan Prakoso <[email protected]>

Conflicts:
	kernel/Makefile
	kernel/apk_sign.c
xvergilantte pushed a commit to xvergilantte/KernelSU-Next that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
ramabondanp pushed a commit to ramabondanp/KernelSU-Next that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
jinetty pushed a commit to jinetty/android_kernel_xiaomi_sm8450 that referenced this pull request Oct 2, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
@aviraxp
Copy link
Collaborator

aviraxp commented Oct 4, 2025

怎么回到/data/user_de/0了

@ShirkNeko
Copy link
Contributor Author

怎么回到/data/user_de/0了

我发现遍历多个用户会有很高的概率造成死锁

xvergilantte pushed a commit to xvergilantte/KernelSU-Next that referenced this pull request Oct 6, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
TheWildJames pushed a commit to WildKernels/Wild_KSU that referenced this pull request Oct 7, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
JJ-Coffee pushed a commit to JJ-Coffee/KernelSU-Next that referenced this pull request Oct 7, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
@Ylarod
Copy link
Collaborator

Ylarod commented Oct 19, 2025

we decided to move these stuffs to userspace daemon

@Ylarod Ylarod closed this Oct 19, 2025
@ShirkNeko
Copy link
Contributor Author

we decided to move these stuffs to userspace daemon

That's great, but I've already done it

beingashwani pushed a commit to Marble-Development-SM8450/android_kernel_xiaomi_sm8450 that referenced this pull request Nov 5, 2025
* Based on tiann/KernelSU#2759

- This may not perfect (such as lock), but tests were fine on ASUS Zenfone Max Pro M2 (X01BD), Android 16 (AOSP)
- Any suggestion or bug reports is highly appreciated!

Tested-by: rsuntk <[email protected]>
Signed-off-by: rsuntk <[email protected]>
Co-authored-by: ShirkNeko <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants