Skip to content

Conversation

@5ec1cff
Copy link
Collaborator

@5ec1cff 5ec1cff commented Dec 22, 2025

No description provided.

@5ec1cff 5ec1cff linked an issue Dec 22, 2025 that may be closed by this pull request
3 tasks
@5ec1cff 5ec1cff requested a review from Copilot December 22, 2025 15:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the allow list API to optimize how the superuser count is retrieved. Instead of fetching the entire list of UIDs just to get the count, it introduces a dedicated getSuperuserCount() method that only returns the count. The API changes also introduce a more flexible allow list structure with support for paginated retrieval.

Key changes:

  • Replaced direct allowList.size access with a new getSuperuserCount() native method
  • Refactored the kernel ksu_get_allow_list_cmd structure to use a flexible array member and separate count fields
  • Unified allow/deny list retrieval logic into a common do_get_list_common function with proper memory management

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt Updated to call the new getSuperuserCount() method instead of accessing allowList.size
manager/app/src/main/java/me/weishu/kernelsu/Natives.kt Removed the allowList property and added getSuperuserCount() external function
manager/app/src/main/cpp/ksu.h Modified ksu_get_allow_list_cmd structure to use flexible array member and split count fields
manager/app/src/main/cpp/jni.cc Replaced getAllowList() with getSuperuserCount() that only retrieves the total count
kernel/supercalls.h Updated ksu_get_allow_list_cmd structure to match the userspace changes
kernel/supercalls.c Refactored allow/deny list retrieval into common function with dynamic memory allocation
kernel/allowlist.h Updated function signature to accept separate length and total count parameters
kernel/allowlist.c Modified implementation to track both returned items and total count separately

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@5ec1cff 5ec1cff force-pushed the newallowlist branch 2 times, most recently from 991087e to 55f0d69 Compare December 22, 2025 17:50
@5ec1cff 5ec1cff requested a review from Copilot December 22, 2025 17:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aviraxp aviraxp marked this pull request as ready for review December 23, 2025 10:47
@aviraxp aviraxp requested review from Ylarod and tiann December 23, 2025 10:47
@5ec1cff 5ec1cff changed the title new get allow list api kernel: use rcu to access allowlist, refactor get allowlist api Dec 23, 2025
@aviraxp aviraxp requested a review from Copilot December 23, 2025 10:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Buffer overflow in GET_ALLOW_LIST

2 participants