Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4695381rdb; Fri, 15 Sep 2023 09:29:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf05GXXKr73jPgI7FjRglVi9CcXfTWyVyCsCmEkZfkI0ZKvGkMVXt6tMYybUpPaUqV8jn0 X-Received: by 2002:a05:6a00:1890:b0:68c:44ed:fb6 with SMTP id x16-20020a056a00189000b0068c44ed0fb6mr2929847pfh.16.1694795347987; Fri, 15 Sep 2023 09:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694795347; cv=none; d=google.com; s=arc-20160816; b=YQ3eYaBlkxv+FngAwxKfr0fPey+N+wz8VFFQZ3sZIdsp1a4rMtLwIa8Cj+npTlSDp2 dmpfGeF1FC7cKdsnPHdJNZI9D7VU4W0zx/4a0CWsbUOi2RtFOLohUV8902LqgBg7ySX6 oclFP2A7ldLCc2j9ikgb+xgja3AlhL7UxKFjcAwzl/fSpbNN6OrV8P3kIB1vGfNn6qbj iXE2rRlAlhqhRqTIyK1oT4ha/KGRI0Nzv/T96HZIjFEvl9CvrSg+HkIo+iJNaXAKuBaG 5Z/ZHqjf3Z9TmD/xRnryiBZ2zPb1/LG97ktumiUhWpPK6CagWaxhXUXGo6zlfITZINeo lX3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Dsb+vZ/wNzxU+PGqZgtnw0b5y8BiUmIVmNV8m8fD/4g=; fh=h+oqCAaiwtFH7G2zIi+LrJhsty/KV7zshKJ6igaqJlg=; b=hVakTeNlVJpQm5wycImF5PpBtoqbb6gYOzDzxpMifXZ+4mgoAfw8JkonvkK5Am6Qpg 7TQWwQdB3CXHeYolyF3fjdt1yk7hUiFFaD6tVrPp4q06X+7VP8BdZ3H1NkQbTEBz62tj kRbdwrZSiLjKDBPJft6tEgr7opndu3QZ/JvavBeMY79gnb0mcc2EV9CUeYpyFv5TXiVS 6gaQ2/u4aVfV9IJETmBCh+0kMFWyi6adHtExMY06pD+Wop9qp2q4Kb+4YKFHsz35EWuc oy00Lg5VjALNGLYYzSitNKD0rtdizsU6idpAxq0EG7LKUwBFJIu/rzxz7OSTbJ/ChWls wTOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=KnI4wj6V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a15-20020a65640f000000b00573fa4cfe44si3548383pgv.170.2023.09.15.09.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:29:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=KnI4wj6V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 89BF882A1F56; Fri, 15 Sep 2023 07:25:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235619AbjIOOZ1 (ORCPT + 99 others); Fri, 15 Sep 2023 10:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235323AbjIOOZ0 (ORCPT ); Fri, 15 Sep 2023 10:25:26 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B8991FC9; Fri, 15 Sep 2023 07:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Dsb+v Z/wNzxU+PGqZgtnw0b5y8BiUmIVmNV8m8fD/4g=; b=KnI4wj6V3Xatl0tegnaIJ jDxAWlPaNZm8QNOt929kp+5bVpIqfSQp4p7vBv7yNF8QEo0J4B/GUkfauS3V2Yd5 jmQnhHd/9ZPtd9KC430EwFtXJE/qTcgSWk2Rubijmx31ojCVfJwq8/r8vOQ+VY+W w70YknHulaJ4JikROVQLvo= Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by zwqz-smtp-mta-g5-1 (Coremail) with SMTP id _____wDHjD39aARla9iYCA--.9810S4; Fri, 15 Sep 2023 22:24:08 +0800 (CST) From: Ma Ke To: 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, Ma Ke Subject: [PATCH] net: sched: qfq: dont intepret cls results when asked to drop Date: Fri, 15 Sep 2023 22:23:55 +0800 Message-Id: <20230915142355.3411527-1-make_ruc2021@163.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDHjD39aARla9iYCA--.9810S4 X-Coremail-Antispam: 1Uf129KBjvdXoWruFW7uryUXr13uryUKrW7Arb_yoWDWFc_ua 4v9r4fAr4fCr1rCw45Ar4qkrZ5KF92vw1fAanFyr9rJw1rAr93Ar1kC39xJ395WF1IkryU Xr90gan8GFnI9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRtdgA7UUUUU== X-Originating-IP: [183.174.60.14] X-CM-SenderInfo: 5pdnvshuxfjiisr6il2tof0z/1tbiyAvrC1p7Lw-xjAAAsf X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 15 Sep 2023 07:25:27 -0700 (PDT) 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; #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; -- 2.37.2