From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0FE41EA94 for ; Mon, 31 Jul 2023 23:52:52 +0000 (UTC) Received: from out-97.mta1.migadu.com (out-97.mta1.migadu.com [IPv6:2001:41d0:203:375::61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E3910C7 for ; Mon, 31 Jul 2023 16:52:49 -0700 (PDT) Message-ID: <8c5398ac-1187-97e3-4124-30a6392e8edb@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1690847567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fw0m3TLuuN632tVVayNUXrrdys6H1C1Dg1mWpY0EH8U=; b=Ig5jGFu/fCYzCvRg7K0/2pAUowLCiwLCuCl70K8WMNz92Lp/eCjQjUMDNfirzH+3WSuapT I5YAeWeskif+kjA1r1NMzygvFEvweShaXsK/YJhSBKCOlsoL9ek+7f4TJ0RWgyZXYQHONK 1D9Oe12dB12juAgsPYUnAy3gmDYVwmg= Date: Mon, 31 Jul 2023 16:52:37 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v4 bpf 1/2] bpf: fix skb_do_redirect return values Content-Language: en-US To: Yan Zhai Cc: bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mykola Lysenko , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@cloudflare.com, Jordan Griege , Markus Elfring , Jakub Sitnicki References: <266ab56e-ae83-7ddc-618e-3af228df81bd@linux.dev> <2f285967-6cc0-c492-6a79-edc233c1368e@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 >>