Hello Joanne Koong, The patch 66e3a13e7c2c: "bpf: Add bpf_dynptr_slice and bpf_dynptr_slice_rdwr" from Mar 1, 2023 (linux-next), leads to the following Smatch static checker warning: tools/testing/selftests/bpf/progs/test_cls_redirect_dynptr.c:403 forward_with_gre() error: 'encap_gre' dereferencing possible ERR_PTR() tools/testing/selftests/bpf/progs/test_cls_redirect_dynptr.c 396 397 encap_gre = bpf_dynptr_slice_rdwr(dynptr, 0, encap_buffer, sizeof(encap_buffer)); 398 if (!encap_gre) { 399 metrics->errors_total_encap_buffer_too_small++; 400 return TC_ACT_SHOT; 401 } 402 --> 403 encap_gre->ip.protocol = IPPROTO_GRE; ^^^^^^^^^^^ The bpf_dynptr_slice() function accidentally propagates error pointers from bpf_xdp_pointer() so it would crash here. 404 encap_gre->ip.daddr = next_hop->s_addr; 405 encap_gre->ip.saddr = ENCAPSULATION_IP; 406 encap_gre->ip.tot_len = 407 bpf_htons(bpf_ntohs(encap_gre->ip.tot_len) + delta); 408 encap_gre->gre.flags = 0; 409 encap_gre->gre.protocol = bpf_htons(proto); 410 pkt_ipv4_checksum((void *)&encap_gre->ip); 411 412 if (encap_gre == encap_buffer) 413 bpf_dynptr_write(dynptr, 0, encap_buffer, sizeof(encap_buffer), 0); 414 415 return bpf_redirect(skb->ifindex, 0); 416 } regards, dan carpenter