-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: refactor max_depth computation in bpf_get_stack() #5825
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
bpf: refactor max_depth computation in bpf_get_stack() #5825
Conversation
|
Upstream branch: d0f27ff |
f4881a6 to
8f9c214
Compare
|
Upstream branch: 2465bb8 |
6b8253f to
53431e7
Compare
8f9c214 to
c9c941d
Compare
|
Upstream branch: 2660b9d |
53431e7 to
caa3e7d
Compare
c9c941d to
c640618
Compare
|
Upstream branch: d3abefe |
caa3e7d to
4a1a7b5
Compare
c640618 to
721f1da
Compare
|
Upstream branch: 4c229f3 |
4a1a7b5 to
1d3ddc4
Compare
721f1da to
c2e9835
Compare
|
Upstream branch: bd27626 |
1d3ddc4 to
92c1dd9
Compare
c2e9835 to
83124e1
Compare
|
Upstream branch: 737433c |
92c1dd9 to
2b4fccb
Compare
83124e1 to
27199db
Compare
|
Upstream branch: 98857d1 |
A new helper function stack_map_calculate_max_depth() that computes the max depth for a stackmap. Changes in v2: - Removed the checking 'map_size % map_elem_size' from stack_map_calculate_max_depth - Changed stack_map_calculate_max_depth params name to be more generic Changes in v3: - Changed map size param to size in max depth helper Changes in v4: - Fixed indentation in max depth helper for args Changes in v5: - Bound back trace_nr to num_elem in __bpf_get_stack - Make a copy of sysctl_perf_event_max_stack in stack_map_calculate_max_depth Link to v4: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Arnaud Lecomte <[email protected]> Acked-by: Yonghong Song <[email protected]>
Syzkaller reported a KASAN slab-out-of-bounds write in __bpf_get_stackid() when copying stack trace data. The issue occurs when the perf trace contains more stack entries than the stack map bucket can hold, leading to an out-of-bounds write in the bucket's data array. Changes in v2: - Fixed max_depth names across get stack id Changes in v4: - Removed unnecessary empty line in __bpf_get_stackid Link to v4: https://lore.kernel.org/all/[email protected]/ Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=c9b724fbb41cf2538b7b Signed-off-by: Arnaud Lecomte <[email protected]> Acked-by: Yonghong Song <[email protected]>
2b4fccb to
da1451a
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=995805 expired. Closing PR. |
Pull request for series with
subject: bpf: refactor max_depth computation in bpf_get_stack()
version: 5
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=995805