Skip to content

Conversation

@gfdgd-xi
Copy link

@gfdgd-xi gfdgd-xi commented Dec 27, 2025

Export the currently un-exported symbols to support some Android emulator such as kmre and so on.

Summary by Sourcery

Export previously internal kernel symbols required by Android driver and emulator support.

Enhancements:

  • Make binder security hooks available to out-of-tree modules via GPL symbol exports.
  • Expose list_lru add/delete helpers as GPL-exported symbols for external users.
  • Export file_close_fd, init_ipc_ns, put_ipc_ns, can_nice, __wake_up_pollfree, task_work_add, zap_page_range_single, and lock_vma_under_rcu for use by GPL-licensed kernel modules.

symbols: Export symbols needed by Android Drivers

Signed-off-by: gfdgd_xi <3025613752@qq.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 27, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Exports a set of core kernel and security helper symbols as GPL-only to support out-of-tree Android drivers and emulator components, without changing their internal behavior.

Sequence diagram for Android driver using binder security helper

sequenceDiagram
    actor AndroidDriver
    participant Kernel as KernelModuleBinder
    participant Security as LSMHooks

    AndroidDriver->>Kernel: security_binder_transaction(from_cred, to_cred)
    Kernel->>Security: binder_transaction(from_cred, to_cred)
    Security-->>Kernel: decision (allow_or_deny)
    Kernel-->>AndroidDriver: return decision
Loading

File-Level Changes

Change Details Files
Export binder LSM helper functions for use by out-of-tree Android modules
  • Add EXPORT_SYMBOL_GPL declarations for security_binder_set_context_mgr
  • Add EXPORT_SYMBOL_GPL declarations for security_binder_transaction
  • Add EXPORT_SYMBOL_GPL declarations for security_binder_transfer_binder
  • Add EXPORT_SYMBOL_GPL declarations for security_binder_transfer_file
security/security.c
Expose list LRU helpers to GPL modules
  • Export list_lru_add for external use
  • Export list_lru_del for external use
mm/list_lru.c
Expose file descriptor close helper to GPL modules
  • Export file_close_fd to allow external modules to close FDs and get struct file
fs/file.c
Expose IPC namespace and lifetime management helpers
  • Export init_ipc_ns to make the initial IPC namespace visible to modules
  • Export put_ipc_ns so modules can safely drop references to IPC namespaces
ipc/msgutil.c
ipc/namespace.c
Expose scheduling and waitqueue helpers
  • Export can_nice so external code can validate nice level changes
  • Export __wake_up_pollfree for modules interacting with poll waitqueues
kernel/sched/syscalls.c
kernel/sched/wait.c
Expose task work and memory management helpers
  • Export task_work_add so modules can enqueue task work callbacks
  • Export zap_page_range_single so modules can unmap page ranges
  • Export lock_vma_under_rcu to allow RCU-safe VMA locking in modules
kernel/task_work.c
mm/memory.c
mm/mmap_lock.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

Hi @gfdgd-xi. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gfdgd-xi gfdgd-xi changed the title symbols: Export symbols needed by Android Drivers [linux-6.18.y] symbols: Export symbols needed by Android Drivers Dec 27, 2025
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants