-
Notifications
You must be signed in to change notification settings - Fork 102
deepin: ARM:Fix segmentation fault when running fuse-bpf on ARM #1083
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
base: linux-6.6.y
Are you sure you want to change the base?
Conversation
The Struct_op operation allocates a single memory page to store target platform binary code.On x86, where instruction lengths are shorter, one page is sufficient. However, on ARM architectures, longer instructions require more memory space, causing the single page allocation to overflow. To resolve this, the memory allocation has been increased to two pages, ensuring stable operation of the fuse_daemon. Signed-off-by: myslqyr <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis patch defines a new ST_IMAGE_SIZE macro (2× PAGE_SIZE) and replaces hard-coded PAGE_SIZE values in buffer allocation, boundary checks, and memory protection calls to double the executable buffer for BPF struct operations, preventing overflows on architectures with larger instruction encodings. Class diagram for updated bpf_struct_ops_map structure and related functionsclassDiagram
class bpf_struct_ops_map {
+void *image
+void *uvalue
+struct bpf_links **links
}
class bpf_struct_ops_map_alloc {
+bpf_struct_ops_map_alloc(union bpf_attr *attr)
}
class bpf_struct_ops_map_update_elem {
+bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, void *value, u64 flags)
}
bpf_struct_ops_map_alloc --> bpf_struct_ops_map : allocates
bpf_struct_ops_map_update_elem --> bpf_struct_ops_map : updates
bpf_struct_ops_map : image field now allocated with ST_IMAGE_SIZE (2 * PAGE_SIZE)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @myslqyr. Thanks for your PR. 😃 |
|
Hi @myslqyr. 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. 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. |
|
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The Struct_op operation allocates a single memory page to store target platform binary code.On x86, where instruction lengths are shorter, one page is sufficient. However, on ARM architectures, longer instructions require more memory space, causing the single page allocation to overflow.
To resolve this, the memory allocation has been
increased to two pages, ensuring stable operation
of the fuse_daemon.
Summary by Sourcery
Increase the executable image buffer for BPF struct operations from one page to two pages to prevent overflows on architectures with longer instructions (e.g., ARM).
Bug Fixes:
Enhancements: