Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5044060rwb; Mon, 31 Jul 2023 17:21:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlElS6xO8dLhgpGPCC/tvAt+pqwl/Wo2A/eI4yQ39Kwv+s6RYyf5jaeIIdbU3l4xPQ0dsMhf X-Received: by 2002:a9d:6f08:0:b0:6b9:f3cb:db4a with SMTP id n8-20020a9d6f08000000b006b9f3cbdb4amr11233357otq.22.1690849319590; Mon, 31 Jul 2023 17:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690849319; cv=none; d=google.com; s=arc-20160816; b=Wl8e5N4kAVJW56how/aRaqvkWsTJL3UYgCuFyrbsTn/zD1dcYO+cIsbpf5ErzAy+Fs 2K9vMNK6AC1MYE0xNTZZEhye5lhsFsUXuVVwChUK2iw25vra+M4/SxHSPjD1lC4uJ3jA Fd3oFO+bVOHw3LNrGAwdiqqsox4Go5PHaooPsv+zS5QH43F7NcRIURnkBc3Zu+A+QuwB VJKCk+h2FAhtlwtgJZ/K99ihLJ1RBOCv5FoP8AlkSCvcUN72YVlXzb7x/XZfN3rAnwP3 daxDPyF6GrKEWED20apjttmSlTMVsb1GG1JbdTF+N6gzTwyisR0+Z5dTPIfbN1sLvC5k TK0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=Fw0m3TLuuN632tVVayNUXrrdys6H1C1Dg1mWpY0EH8U=; fh=Y9oS8IEtZ89Fm0x8bg3UBmK/eL30cPuOlM1f8vIZueo=; b=oWuJGzdttB/SPxAwrkemM0WxOeDMhf4KHoe04mlJtOnoqgtgJRxv1w2G0Y9jVrkw/G 5QKk1Bsg2wToYLLFxAoYflC6GsJVVnWedT7sTrEoAPTKQuNjbK6gfM3A/0gq7i1bu9zL baXS3DyjhGV9+3BuOl89IOd3k7YlBaKUwlQwJZx+8wKLxd4xjTk2Hfyw7938MmOtx1eh foHgHwDhZMmcNxpVhmcQJZR08EwNyAnplIQYhlHtJmrt16CQCMVvsVTAwcMJTNU7mJ/0 ogVz8sbDG2JqpDJSb6tasMRwZSrHAxWd59oE+Ua74h2/xkDKSq43ix7lsp2qo9hvsyaN Kutw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="Ig5jGFu/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r23-20020a635157000000b00563e23a5520si7706216pgl.353.2023.07.31.17.21.47; Mon, 31 Jul 2023 17:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="Ig5jGFu/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbjGaXxE (ORCPT + 99 others); Mon, 31 Jul 2023 19:53:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjGaXww (ORCPT ); Mon, 31 Jul 2023 19:52:52 -0400 Received: from out-87.mta1.migadu.com (out-87.mta1.migadu.com [IPv6:2001:41d0:203:375::57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95CB110C1 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>