Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4552971rdb; Fri, 15 Sep 2023 06:00:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvqSG3J/6ae6Y0TlB5OAVHaMwDwQabGbW5IEcR+Tv70ugRNtElWYdM4VKmqJEIGuWPOOYv X-Received: by 2002:a17:902:f54b:b0:1bc:2d43:c747 with SMTP id h11-20020a170902f54b00b001bc2d43c747mr1608141plf.38.1694782807572; Fri, 15 Sep 2023 06:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694782807; cv=none; d=google.com; s=arc-20160816; b=eJK66zpjQftnHffeHtuqxBDehH4rRtyfRfPjNqW3zqj/j7/CdXY82F/iKMvESv+LsO 1gMAe/J6o42uenPWGvPiASG1P60xndtBSz0aVvd8Bvq/ZK6SSC/On6HGEmEl1gq6O6jN wJ7UzQovoEb7iPkPc9IkkN9IWK9XDKZiPKjLEuco6TLrLnsUpHm2e7jttr8zqRBJ7nwk 043GPoOxMY1CUERYX7mlbLfYsaqoJk2OYFPDc92y5wJi+L2bx7uzamNvb5sLcEP2B0V9 CyNNJv1g+umETuV0uYsHmrEkshh7mJK3YHBPx46adYac+Y/BKe8gi/F50y9S66sJt3n7 2UDQ== 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=ZcuMOBJNB817DaLLKwvFYiTctCwx4E0hPvxhRSMQXLw=; fh=Lhc+B1IAKUn1RsxuJHH46lwvOqIzUUbVW8X4qBDgKzA=; b=H+kO2d/lckt+CG8LehpVpZJNz7d14EmI9lhQwCLFU2ktPsO48bRwo6TN7LKRgyachB qMBaxbSBpdejDZLr+ReVRlMhl6O2iKNP6Od+fyg8/TcazvC1rK/DFkzFKoZv1JS/nomK K5AzFOgu1qH81HfX7TEKYy2eXM3UoPTdiYyAeVQMEp01zApdQALEaZieYwba/xoRVX/V 2l1pxkzNUNXtk5ycwXCCajkerJohivAKCZ+hGguWn3vYFwCH2EGwlL7uepDXtt556kc5 vpxyKoOo0zOQ2dwwVUG4iBl+418Hky93Ewt5KAsrX8bUa+02+79BgQHD/892N3kjk+l5 tLEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Sd4ylr/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e4-20020a170902f10400b001bb20380bf9si3231002plb.545.2023.09.15.05.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 06:00:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Sd4ylr/w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 53DD38119D30; Fri, 15 Sep 2023 05:57:53 -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 S235190AbjIOM5x (ORCPT + 99 others); Fri, 15 Sep 2023 08:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbjIOM5w (ORCPT ); Fri, 15 Sep 2023 08:57:52 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C81C1713 for ; Fri, 15 Sep 2023 05:57:47 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-41761e9181eso241831cf.1 for ; Fri, 15 Sep 2023 05:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694782666; x=1695387466; 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=ZcuMOBJNB817DaLLKwvFYiTctCwx4E0hPvxhRSMQXLw=; b=Sd4ylr/w4b27Y4Jud2xK80qzK/420nsiKmEpXDe/X62IHlKuvOjUaVycOrk7bq2StU h/CNAZHA8PjLBDvMnZYFbXrlU6C83iCqs5td7kszQYMW8if8MqKOZx+5QpDexG+RKVgl aHlgTcLyzUTEEmMSw7ed80hN9vi4UXg7FguwegeOTh0u5KqJSekqLKezOoNQ95TiZHjf x1Z+aFxfw0mB0/6jBWB8rHHbhPxsFF33DqueinyzbBBf0HTD/j4NaQ8pciep0MsZX0rT M9FhwG7gxWPImfXAJSPfYooOvOM7NvbVvb7o4HyeAmHxvKLApOXUjF/r/dS0iTmforvF sX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694782666; x=1695387466; 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=ZcuMOBJNB817DaLLKwvFYiTctCwx4E0hPvxhRSMQXLw=; b=uYRq2isD1HMpYCtAbFZpfSs9L/zn6zUG7BKQaBmT1bYdp/p45N62jbiDbd3QqPNXPS YJeZRJJ9vA/c5ahBPVqxQfT0JNQxGTtDvZhCEkyqg+EYq0F7UmUZmOCVaiLYlFGQjdts Vr/NKVapdjBTimRLnXwanBMRPge7X+FIUM+pDXtl4CqZt4YoeA8OTKqapTfR08Gpm+z4 fLYYPZ3r22oNy+EfkUR9gIZSU6BrH9blRcmhuRR1owNaQYm0Cepwz2bC3Ob52nhjQv4i 6yLF/wfN5W1TLHu5uK0zKd3dfvPx8w/wN80hgmbcWdpfz/PG3vN/1L5mhGGFN8IZ3Oyu UOjg== X-Gm-Message-State: AOJu0YydGbUDBKnJ86XxzJJSFLVh9b4auaY57aorqL59GV6Kdr7oi5Tp gzLz9a51hfMxJzxFVXEH0EMcK0M76VBbq+ECRWLD1g== X-Received: by 2002:a05:622a:60c:b0:405:47aa:7ffd with SMTP id z12-20020a05622a060c00b0040547aa7ffdmr174104qta.19.1694782666113; Fri, 15 Sep 2023 05:57:46 -0700 (PDT) MIME-Version: 1.0 References: <20230915121841.3408778-1-make_ruc2021@163.com> In-Reply-To: <20230915121841.3408778-1-make_ruc2021@163.com> From: Eric Dumazet Date: Fri, 15 Sep 2023 14:57:35 +0200 Message-ID: Subject: Re: [PATCH] net: sched: hfsc: dont intepret cls results when asked to drop To: Ma Ke Cc: jhs@mojatatu.com, 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 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 05:57:53 -0700 (PDT) On Fri, Sep 15, 2023 at 2:37=E2=80=AFPM Ma Ke wrote: > > If asked to drop a packet via TC_ACT_SHOT it is unsafe to assume > res.class contains a valid pointer. > > Signed-off-by: Ma Ke > --- > net/sched/sch_hfsc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c > index 3554085bc2be..2a76027b14e6 100644 > --- a/net/sched/sch_hfsc.c > +++ b/net/sched/sch_hfsc.c > @@ -1135,6 +1135,8 @@ hfsc_classify(struct sk_buff *skb, struct Qdisc *sc= h, int *qerr) > head =3D &q->root; > tcf =3D rcu_dereference_bh(q->root.filter_list); > while (tcf && (result =3D tcf_classify(skb, NULL, tcf, &res, fals= e)) >=3D 0) { > + if (result =3D=3D TC_ACT_SHOT) > + return NULL; > #ifdef CONFIG_NET_CLS_ACT > switch (result) { > case TC_ACT_QUEUED: > -- > 2.37.2 > Same comment, already handled at iine 1145