Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5021578rwb; Wed, 21 Sep 2022 01:57:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lEvgVJTzhOJhwIuv7zN5FkUVqCQhm9dvgoAm/e6Y2lA/CLxQG151inIRFC8inofeZHLl7 X-Received: by 2002:a17:907:a0c7:b0:77c:d4ac:e8f1 with SMTP id hw7-20020a170907a0c700b0077cd4ace8f1mr19576042ejc.354.1663750642455; Wed, 21 Sep 2022 01:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663750642; cv=none; d=google.com; s=arc-20160816; b=sDWuo+96HMe5i2R3NnVTRzY8lGwsry+rrVztY7XukrZoTIC9jZdgaPo4kSag39sk/6 lFZT6W/uEI5sRaZ1XYRVRW079lsmIUAuYamPDrvpP/Q7CI4I6WsF29kf6i2IHTBrX/H+ hsOMQ/wmpJ4/c+eJUBwND1mpeaeVZLHhVA9ilyR8RPuc3DbGOjvSyufHqwWMZaKgzyNp eVsJuVc5iNnBKjPD+9LrabjXVh1OBiDemafYQPh0LmpKw9x4YMutYarM1Ofdr7E4K91x nMJ45fk0xPpxQ5+9Jz5TXhFCJuoBWOi5IlPY97yxWFFZtgLiyer+HXQ7iYfyXHN5vjL+ KlBA== 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:subject:user-agent:mime-version:date:message-id; bh=+/ulJlhg4hjA0bvJ9OfxnGRWpgBo7/9SmRQhLlybYhU=; b=kNd1CiCtAMioVIzEQe0lXxKDJSHOLtWl4lyurM2Ee4TcrK0pf8G0dIKxbFIOoLeucT KOUh8b8vIFwdlj3F+gh/85kzq6AOzg9Qx9NbpZm1zaStxVNxu/fO0Q64oywUvKAMFveJ 9LUTL+XbrnRP911pgphA9PXN9fE4fPW58RlZOm8crLz8ycyXmPjztij7H2HszLWvYHOC ThP/GmudBdHLFdLb50OXoM+bOlr09XN9L6b7P+RnOTytdqJvc3JxEmwKWPr5HQGZ/Ec2 NCfIVnNuJCglCYkGxkSQp/78LQD6pqHwnWCiqdptLSUaOjnRYpfFgpsgQzhmxbHVrHN1 c+qg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w26-20020a50d79a000000b0044880841e1asi1836078edi.347.2022.09.21.01.56.55; Wed, 21 Sep 2022 01:57:22 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbiIUIs0 (ORCPT + 99 others); Wed, 21 Sep 2022 04:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbiIUIsQ (ORCPT ); Wed, 21 Sep 2022 04:48:16 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9373B7B78D; Wed, 21 Sep 2022 01:48:15 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MXX5L6wcmzlVjg; Wed, 21 Sep 2022 16:44:06 +0800 (CST) Received: from [10.174.178.66] (10.174.178.66) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 21 Sep 2022 16:48:13 +0800 Message-ID: Date: Wed, 21 Sep 2022 16:48:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.2 Subject: Re: [PATCH v4,bpf-next] bpf: Don't redirect packets with invalid pkt_len To: Lorenz Bauer , Stanislav Fomichev CC: , , , , References: <20220715115559.139691-1-shaozhengchao@huawei.com> <20220914111936.19881-1-oss@lmb.io> <5a3c5ea9-d557-6070-d778-1092f3c51257@huawei.com> From: shaozhengchao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.66] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 2022/9/20 22:42, Lorenz Bauer wrote: > On Mon, 19 Sep 2022, at 11:55, shaozhengchao wrote: >> Sorry for the delay. I'm busy testing the TC module recently. I'm very >> sorry for the user-space breakage. >> >> The root cause of this problem is that eth_type_trans() is called when >> the protocol type of the SKB is parsed. The len value of the SKB is >> reduced to 0. If the user mode requires that the forwarding succeed, or >> if the MAC header is added again after the MAC header is subtracted, >> is this appropriate? > > We don't require forwarding to succeed with a 14 byte input buffer. We also don't look at the MAC header. > > I think refusing to forward 0 length packets would be OK. Not 100% certain I understood you correctly, let me know if this helps. > > Best > Lorenz Hi Lorenz Sorry. But how does the rejection of the 0 length affect the test case? Is the return value abnormal, send packet failure or some others? Zhengchao Shao