Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4702959rdb; Fri, 15 Sep 2023 09:41:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHLG4k614m+AksoGHobRQWljvGUG8DtZi/QdcMyTHakx6x1elgJ161WCeP48IaWy7Eq9Bk X-Received: by 2002:a17:902:d4ca:b0:1c3:1316:ea52 with SMTP id o10-20020a170902d4ca00b001c31316ea52mr2756706plg.61.1694796071018; Fri, 15 Sep 2023 09:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694796071; cv=none; d=google.com; s=arc-20160816; b=V77zSMf7sqYq/vrUgOmeVo1VZpx2lBZrzgGoqTtETowzE7NmWwsXxtDjdVFGU0oj3P kvzQMcFk5klCT1WBKRpr/xf8dCzdqDSqhWmUuk4VB4qq35HqRI8WnZWFFGvR4slekwW8 YVgwnmZPvjoOoIp0KDbl5X7IuDo7nipECegeigaXkposq/f/WAZG9pDJxr150kwWRQ6I LO+uqCiBL0Z/dSto+E/ChxmrrhV7uvoMdI/bqA9R8IebmksPO7sR0P2Ly0D22wwxfkbz sIjAcB+TuOZ4zlT7O3baKgmdoHTGyp5B+Pxr3rOneR69hHeK06CeqgD3m3StO+gUfX62 o3qQ== 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=vPHy6FbUY6qMDmcdSpgvW83WHD8MuvuLRYVKW+S0nuI=; fh=Lhc+B1IAKUn1RsxuJHH46lwvOqIzUUbVW8X4qBDgKzA=; b=eAqBh1ydBBn5+JaotMLf6A/Acu8uuRzkLH6dMW4I3Y1TirlIU2CtuEHGI+l2ctbW83 4VcDRJI5xfvEdXC0Cqjh+1X5liPAKFdj2HSRDpqHkh2T2ycIE5Po6HHeexWNDfWNDfhd go0odHl8fIOhwZrvWwzKLW1drt62fY7R0ImKsSrQSWBOzR47ykD7UeEZXFl4myfproHA ZDAQxrJZhBjcPxeRQCiszEhAeEJksU9ATr2om9XeVYwTpOPWE1h1C4aMHAVQ+iMAZjKc 5vd4dFG4oqYJNqtF5wF56CUW4Mi9EwaZmZg9vgMFij2fG69CBVmHpZgNNNVPtpJaBgYW l3zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FYbllhMb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h7-20020a170902b94700b001bbfbe6bf3esi3378857pls.504.2023.09.15.09.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:41:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FYbllhMb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 48B98809343D; Fri, 15 Sep 2023 05:55:35 -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 S235034AbjIOMz0 (ORCPT + 99 others); Fri, 15 Sep 2023 08:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234962AbjIOMzZ (ORCPT ); Fri, 15 Sep 2023 08:55:25 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 022F71713 for ; Fri, 15 Sep 2023 05:55:21 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-41761e9181eso241161cf.1 for ; Fri, 15 Sep 2023 05:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694782520; x=1695387320; 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=vPHy6FbUY6qMDmcdSpgvW83WHD8MuvuLRYVKW+S0nuI=; b=FYbllhMbbEtVzEYLkr5eCj8ggR9cnp3YNPCc/t5Av80CURgM5FSLvPSmnrpV43ox96 2G6wFsboNZmFUbx8g7lqr3rM/8rGgTC+D9mX4+ZVFde0iCYHxgoN+4J8UHXMaj27w2Nc K76nL2KL2ag8CqMDB9iFi9udkxG8VKxE+FYDdeoKs3EHgbRpw0yBHnW6J7YDIcnTFSLu gBu3QBWYuXn8FopcNXJfcriJnig8NA0yemexJWxvgqNI5+Ii0J1ym4i97niGmdXwIv+X 2OmeXntdnDyaCLjQ9rqNwykFHaUl/nVke4YCgMwzyfovAjsxUcg9OlLXgRU70Hx/Qf1W /UTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694782520; x=1695387320; 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=vPHy6FbUY6qMDmcdSpgvW83WHD8MuvuLRYVKW+S0nuI=; b=EoD4IE7ZBPHlleQXx92cxmaDTgdUIhwzpzpYifn3mWhHY9vTPhaTMCc7SsweKP0w3B rcG5v4ih6PyyymdlGx6r2V3wSLAWrCxHe/PfFxpffMOZCS0ZtowI50NBtOzss9WNaNm2 kS3GJxTwXYu7O5hyt3UonncqvcbyO2JBNzTvjHoa23poqnfqLUkJ62lkxziqKRhpo2RD j3L1ADeDvZVrTq74ddf/SaLGkOOTD+C34xQLIt7GUPiiMONG8FN8xThBnUlU6abIi8zA U3NmwPmbf7an4c36Pbi1JO5kmi7zXUUgCGvFGos76ZHbFoGrA4MVd/4OO9KIRsDJesT7 7/4A== X-Gm-Message-State: AOJu0YzvVJc6qP08zP80toiSvmRroMUAOmHIcNIkLXLBT1NohXP0JScy jqBjcGoMz2kEQVYaakL3Nj6QxiWcn94YezmIXsvEjQrJLrtz+xrKdMI= X-Received: by 2002:a05:622a:1a86:b0:3f2:1441:3c11 with SMTP id s6-20020a05622a1a8600b003f214413c11mr236689qtc.2.1694782519819; Fri, 15 Sep 2023 05:55:19 -0700 (PDT) MIME-Version: 1.0 References: <20230915104156.3406380-1-make_ruc2021@163.com> In-Reply-To: <20230915104156.3406380-1-make_ruc2021@163.com> From: Eric Dumazet Date: Fri, 15 Sep 2023 14:55:08 +0200 Message-ID: Subject: Re: [PATCH] net: sched: drr: 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 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:55:35 -0700 (PDT) On Fri, Sep 15, 2023 at 12:42=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_drr.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c > index 19901e77cd3b..2b854cb6edf9 100644 > --- a/net/sched/sch_drr.c > +++ b/net/sched/sch_drr.c > @@ -309,6 +309,8 @@ static struct drr_class *drr_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 > I do not see a bug, TC_ACT_SHOT is handled in the switch (result) just fin= e at line 320 ?