Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4921082rdb; Fri, 15 Sep 2023 17:22:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3yQEj0PhPWSceldUjakf3W4sS7k06Vp0/9zZi5C0Ci5NYaS0reuU0oWL3vbEMXXHDI8J6 X-Received: by 2002:a2e:988b:0:b0:2b6:e618:b593 with SMTP id b11-20020a2e988b000000b002b6e618b593mr2889198ljj.31.1694823720908; Fri, 15 Sep 2023 17:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694823720; cv=none; d=google.com; s=arc-20160816; b=aZizvcdRnFBFnZMNG18q6tdsjcnmeSIvs0HG4Fom6X0mb0DUeRaUPqourtCA0JqYCX r0h7d5ioFUfT0J/+shGG8THE122lL86nb1l7zNcS1mPs6e9TrV7jOp2l/jgZAyWFcc2X EfTTQoGZDW9trvJFZv+U7v7e/fgvFEPhQM4mrQMdxJPillg+4iJarxrSY6qZezIbZ40e 40hQ3BMttNbKpH65RtdIoC/g5wPtFpn38tqQgWd50NizYrNHbCgDegYBFeTNrQ8nZ1ea lRSzhwlS7tlY8nxi1OFzyMMmwW47h73IUuVATgKJZqrrQfiOkDK9FN085cng+EnTSif1 HLJw== 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=zZu5o0cgVYXAFH7d9696U+gHAz/I7CL0OXnkm5dCDf8=; fh=YBaxXdRNB2oIsnj3h4lK9D2IOOz7IBF13qzrtJ96ZP4=; b=SWFXecjrfnrsmQnbvw1eht7QSsWqrcNPpEXRNRUTgXnDEPteZcdYjCuGPYON4rinvY FBlMSbOjSVO+X7/6s+nEhFBn18644UScfEYf5dKXIzzrSsODxk62pBPpHuQ5o94y+5QS uG5GLM8UDTDJ84U9vrS9pY0D0PyT8rSVi9BdTRScBawWtJgPCtsNEZzJh+b1dJqCV4MZ F8FiNpCRvCw/5dLLdK7MwbxrwK6AV8xYebVJO2M/Iub0UG7TDu4r/KtrC4/rR9AgNJf6 9itxDu6JkBDLQLbEqg/F41E1bkIqYbqmzwJM+Lwxzozu0odfGUZe44xao2thEEt8W6Cq DGNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ArCTnuBF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id rv22-20020a17090710d600b00992e90ca00dsi4086961ejb.16.2023.09.15.17.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:22:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ArCTnuBF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D833880473EF; Fri, 15 Sep 2023 13:46:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237315AbjIOUpl (ORCPT + 99 others); Fri, 15 Sep 2023 16:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237290AbjIOUpX (ORCPT ); Fri, 15 Sep 2023 16:45:23 -0400 Received: from out-211.mta1.migadu.com (out-211.mta1.migadu.com [IPv6:2001:41d0:203:375::d3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3041118D for ; Fri, 15 Sep 2023 13:45:18 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694810716; 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=zZu5o0cgVYXAFH7d9696U+gHAz/I7CL0OXnkm5dCDf8=; b=ArCTnuBFrZVZMvsfRzsFhqroZehMZUBRALdUc4bMzmQq2Q7492lBhGukC9uInB4RKhrBz2 7ehHSbx2VaI3j8kX6772ZWNTwZtohLKarNF9PJFco5jmi3IkQtEVRK2Yu9CPOrOuyV6aBI qFnY9fBRoFi2xRIgc83tvyG7JBzFIk4= Date: Fri, 15 Sep 2023 21:45:13 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] net: sched: qfq: dont intepret cls results when asked to drop Content-Language: en-US To: Ma Ke , jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230915142355.3411527-1-make_ruc2021@163.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20230915142355.3411527-1-make_ruc2021@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 13:46:12 -0700 (PDT) On 15/09/2023 15:23, 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 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c > index 546c10adcacd..91c323eff012 100644 > --- a/net/sched/sch_qfq.c > +++ b/net/sched/sch_qfq.c > @@ -696,6 +696,8 @@ static struct qfq_class *qfq_classify(struct sk_buff *skb, struct Qdisc *sch, > fl = rcu_dereference_bh(q->filter_list); > result = tcf_classify(skb, NULL, fl, &res, false); > if (result >= 0) { > + if (result == TC_ACT_SHOT) > + return NULL; The same comment again - the check is meaningless. > #ifdef CONFIG_NET_CLS_ACT > switch (result) { > case TC_ACT_QUEUED: > @@ -703,8 +705,6 @@ static struct qfq_class *qfq_classify(struct sk_buff *skb, struct Qdisc *sch, > case TC_ACT_TRAP: > *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; > fallthrough; > - case TC_ACT_SHOT: > - return NULL; > } > #endif > cl = (struct qfq_class *)res.class;