Skip to content

Conversation

@lax-fly
Copy link

@lax-fly lax-fly commented Jan 14, 2026

fix patch before(check url below for details) might not work until pahole support BTF weak symbol override.
This commit is a temporary workaround, ugly but effective, and should be remove in the future when pahole is updated

fix patch before:
#1393

fix patch before might not work until pahole support BTF weak
symbol override.

Signed-off-by: xulang <[email protected]>
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @lax-fly, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

4 similar comments
@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

@lax-fly lax-fly changed the title [Deepin-Kernel-SIG] [linux 6.12-y] bpf: a temporary fix for bpf_lsm_mmap_file null access [Deepin-Kernel-SIG] [linux 6.6-y] bpf: a temporary fix for bpf_lsm_mmap_file null access Jan 14, 2026
@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

1 similar comment
@deepin-ci-robot
Copy link

Hi @lax-fly. 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.

Copy link

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 pull request adds a temporary workaround for a null pointer access issue in bpf_lsm_mmap_file. The workaround manually marks the first argument as potentially null until pahole tooling gains support for BTF weak symbol override, at which point the existing __nullable suffix mechanism in bpf_lsm_proto.c will work properly.

Changes:

  • Added a hardcoded string comparison check in btf_ctx_access() to mark the first argument of bpf_lsm_mmap_file as PTR_MAYBE_NULL

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

* ugly but effective, should be removed while BTF weak symbol is
* supported by pahole
*/
if (!strcmp(tname, "bpf_lsm_mmap_file") && arg == 0)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Using hardcoded string comparison for a single function creates a brittle workaround that doesn't scale. If other LSM hooks have similar null pointer issues, each would require adding another hardcoded function name check. Consider a more systematic approach such as maintaining a list or set of affected functions, or better yet, investigating why the existing __nullable suffix mechanism doesn't work and fixing the root cause.

Copilot uses AI. Check for mistakes.
info->reg_type |= PTR_MAYBE_NULL;

/* a temporary workaround for bpf_lsm_mmap_file null pointer access,
* ugly but effective, should be removed while BTF weak symbol is
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Corrected spelling of 'while' to 'when' in the context of future action. The phrase should read "should be removed when BTF weak symbol is supported" rather than "should be removed while BTF weak symbol is supported".

Suggested change
* ugly but effective, should be removed while BTF weak symbol is
* ugly but effective, should be removed when BTF weak symbol is

Copilot uses AI. Check for mistakes.
@opsiff opsiff merged commit 0d3594d into deepin-community:linux-6.6.y Jan 15, 2026
17 checks passed
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: opsiff

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

The pull request process is described 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.

4 participants