Re: [PATCH v4 bpf 1/2] bpf: fix skb_do_redirect return values

From: Martin KaFai Lau
Date: Mon Jul 31 2023 - 19:53:06 EST


On 7/31/23 4:01 PM, Yan Zhai wrote:
What I commented was an exact same issue at different location: BPF
reroute may trigger the crash as well, since it also returns
dev_queue_xmit status in bpf_xmit. Need to fix this, or instead fixing
LWTUNNEL_XMIT_CONTINUE value and correct the behavior at lwtunnel_xmit
rather than bpf_xmit.

Ah. I think I got it. You meant the bpf_lwt_xmit_reroute() / BPF_LWT_REROUTE case? It would be clearer if some of these names were quoted instead. "reroute" could mean many things.

Please put details comment in v5. Thanks.


Yan


As Dan suggested, packets might not have been freed when this is
returned from drivers. The caller of dev_queue_xmit might need to free
skb when this happens.

Yan