Skip to content

Commit

Permalink
fix: try to fix "R3 min value is outside of the allowed memory range"
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Jan 25, 2025
1 parent 71159c6 commit e91bcf0
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 1 deletion.
Binary file modified bpf/bpf_arm64_bpfel.o
Binary file not shown.
Binary file modified bpf/bpf_legacy_arm64_bpfel.o
Binary file not shown.
Binary file modified bpf/bpf_legacy_x86_bpfel.o
Binary file not shown.
Binary file modified bpf/bpf_no_tracing_arm64_bpfel.o
Binary file not shown.
Binary file modified bpf/bpf_no_tracing_x86_bpfel.o
Binary file not shown.
Binary file modified bpf/bpf_x86_bpfel.o
Binary file not shown.
3 changes: 2 additions & 1 deletion bpf/ptcpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ static __always_inline void handle_tc(bool cgroup_skb, struct __sk_buff *skb, bo
event->meta.payload_len = payload_len;

if (use_ringbuf) {
if (payload_len > 0) {
// avoid "R3 min value is outside of the allowed memory range"
if (payload_len > 0 && payload_len <= g.max_payload_size && payload_len <= skb->len) {
struct skb_data_t *skb_data = (struct skb_data_t *)(event + 1);
bpf_skb_load_bytes(skb, 0, &skb_data->data, payload_len);
}
Expand Down

0 comments on commit e91bcf0

Please sign in to comment.