-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.6-y] bpf: a temporary fix for bpf_lsm_mmap_file null access #1435
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
Conversation
fix patch before might not work until pahole support BTF weak symbol override. Signed-off-by: xulang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this 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 ofbpf_lsm_mmap_fileasPTR_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) |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
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.
| 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 |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
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".
| * ugly but effective, should be removed while BTF weak symbol is | |
| * ugly but effective, should be removed when BTF weak symbol is |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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