Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4686371rdb; Fri, 15 Sep 2023 09:15:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHceadzXTkvSa8cYYwAfzla85Sdn2x0GMuvf209K/4CrRwxTGc163mliyhQSgEkMNfehDp3 X-Received: by 2002:a05:6a00:cd1:b0:68a:4d66:caf with SMTP id b17-20020a056a000cd100b0068a4d660cafmr2384734pfv.34.1694794513477; Fri, 15 Sep 2023 09:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694794513; cv=none; d=google.com; s=arc-20160816; b=mLJFkpqp5PgSkmySq5DMD4+Vp5bjc/pYL117WGkVDE89CdFEcZ9IMsmeRQUKdKpxJs KAYNZlXCkHPlbfK4btmZ6M5OUjtqVZdzDegjXTCulyV6LNSqGUv/dPKvMCo99wux4fuf 7kIPjBI3OjGRzlMykQ56JBV8cwwt4IOsOZHkLCkB+Ni6glBEi14+In+zMaM94IhXdKd5 +9jDqITdfDE2cYuzK1muFuhQziU2JcSzng+B6gKLVkpfWocRTLiibPozAQeHUdoK1u6E tsSRRkF9tJNh4tL6+piL4+Gi+I/t5b9JYpKWwPdS6pitqQMdW+8XlRv9L7w2ItrPtZIB xA/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=POzX7W8BdLozOP6jMEbD1FJiIlYH4jYiXUDV3kPwj2A=; fh=FgSXULNaJuN9zGPWHr38+PvCtlW2coBnGsZ4XofMv9M=; b=iPYrTsZBzkJ7pydxRsFHJ1/S9Nawza6hdZT/6lE8kZ7B7hz9no8DeHJLmEACWrX2u3 3Gj4OGKSNprOM70bBkqstij/CU9Owt9b2bAJ9jipUuxhRijdb1P5mpBIQTP/onP72zug K0yQTagpaLqEj4lsaBJwogULEbBuI2yftl+5GbQ4s0/DHFqQQQePI3Gp5ZPkPLzNdV4B 7danOOV77eIsjfS9QtYLHklmfi6Dg0fuhVNgID50kzxx+JW2MfYLtWle0M7shv0SUbLg w5Luw9AYp6WYO7mAAPwOjNm0kTR6ar4Y4dy47je4tU1A40aBXkDXTfUMVUji9o9oivI/ 2afg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4oUuiIgB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t2-20020a62d142000000b0068e40491f6esi3380250pfl.270.2023.09.15.09.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4oUuiIgB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 550AB80B31F3; Fri, 15 Sep 2023 05:56:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235155AbjIOM4d (ORCPT + 99 others); Fri, 15 Sep 2023 08:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235117AbjIOM4c (ORCPT ); Fri, 15 Sep 2023 08:56:32 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CA0310E for ; Fri, 15 Sep 2023 05:56:26 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-41761e9181eso241441cf.1 for ; Fri, 15 Sep 2023 05:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694782585; x=1695387385; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=POzX7W8BdLozOP6jMEbD1FJiIlYH4jYiXUDV3kPwj2A=; b=4oUuiIgBJX8CCHZaLRQsCQnKf1CUrHMxySXrBX29xfOr2vDsvR9D6ECmEhb7qsYVBs +QnQpF3yJcJJ1Tn6JE6BvyFR8TS9U7jlKglu7sCJUGvnfJhSaQz7kKYefvuHEYsu7meT 8kmDge9EWosB3+3SWqsHLZZ/WUXAjmHla50dmu6fNeaQTHZpXun9ZG8R0uwrqqOGwi5J yjQaNrPlO5bjQktWx9ReWUxj6m1f5iydLCQb35fmaxclso9OhYRIJpJSeAkw+vK9Rqa3 88tDEk6vUS871y4t1G08zP1w0QKnr6OvC0cAeZ2uOD7HO1idd1CRcj2j0+FDCgvMxknp 7ePQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694782585; x=1695387385; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=POzX7W8BdLozOP6jMEbD1FJiIlYH4jYiXUDV3kPwj2A=; b=p2wnsP8d/sPbPNoBBL8jEBbe1XYDGfMtS9Ath4+wUoxlo0Kl/0TO69oVsN3x8NhKx8 yPqjQ7TC2iQKuGJ2fbeAnqDpzZtUDHWPLTOW3IRQlFXuG7D0rnRD2KPYzk8I8cv1IfDW vw9S35IGwjeGrwjlBXEjE5CJnR3XupCMDY1d+q6mS2Fo2+NvPpk6M6tbdKKcutonqMzc ON+esvQilWeTQP9roPAxGO0PUX15GCitJ9jEjErl3OENuM1G8CbbbERF5RzaQKST4Rdm jdGHtzGIr/ssWRCDz0Zc73FZF8G13KLuGm2dX9ixwReeWpmMcHu/vODFuznMQxYyGD4o 74DQ== X-Gm-Message-State: AOJu0Yygmv0WqnzNAjDABmntsoTR1vlRqCpA8QBGQqOHAKS+k6fLi/0v JusCzS9l9B6Kakei5oe7fUM8BSk3TpCFh5LekDRW/g== X-Received: by 2002:ac8:5b53:0:b0:410:653f:90ea with SMTP id n19-20020ac85b53000000b00410653f90eamr165544qtw.1.1694782585290; Fri, 15 Sep 2023 05:56:25 -0700 (PDT) MIME-Version: 1.0 References: <20230915105036.3406718-1-make_ruc2021@163.com> In-Reply-To: <20230915105036.3406718-1-make_ruc2021@163.com> From: Eric Dumazet Date: Fri, 15 Sep 2023 14:56:14 +0200 Message-ID: Subject: Re: [PATCH] net: sched: qfq: dont intepret cls results when asked to drop To: Ma Ke Cc: xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 05:56:32 -0700 (PDT) On Fri, Sep 15, 2023 at 1:08=E2=80=AFPM Ma Ke wrote: > > If asked to drop a packet via TC_ACT_SHOT it is unsafe to > assume that res.class contains a valid pointer. > > Signed-off-by: Ma Ke > --- > net/sched/sch_qfq.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c > index 546c10adcacd..20d52dc484b6 100644 > --- a/net/sched/sch_qfq.c > +++ b/net/sched/sch_qfq.c > @@ -695,6 +695,8 @@ static struct qfq_class *qfq_classify(struct sk_buff = *skb, struct Qdisc *sch, > *qerr =3D NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; > fl =3D rcu_dereference_bh(q->filter_list); > result =3D tcf_classify(skb, NULL, fl, &res, false); > + if (result =3D=3D TC_ACT_SHOT) > + return NULL; > if (result >=3D 0) { > #ifdef CONFIG_NET_CLS_ACT > switch (result) { > -- > 2.37.2 > Same comment, it seems already handled at line 706