Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4233131rwr; Mon, 8 May 2023 05:06:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64/snnCkDcvZkD/XOr6XQZ8hk5IkPWdxzAIO3ZM9RwuqWddWEnJh6v0uYcQHPj96gcaecC X-Received: by 2002:a05:6a21:7886:b0:ec:88e1:1452 with SMTP id bf6-20020a056a21788600b000ec88e11452mr13064522pzc.62.1683547598360; Mon, 08 May 2023 05:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683547598; cv=none; d=google.com; s=arc-20160816; b=xvz34T5lk1nuiH0Qiu+dg6nhjdtUT36Cq6rNhUrQXZuu97eI1kkDvuZ2IiKue5Yhmf L/i8x/qRn4avBdILGEoHcmamfaO81ib58A9Y30guGDzcTxSs1EF5Sn6ACy7EzZPl7hfy brCFa+oGfhpSM1FyFtecUr07d3JUh7p6nBBNGHLTEWdOtnLQG6WlXmUOk47XIum89x84 4hR6OchSP50A9cJoIa+7lGsMB3e2kOb4cZgNVBpD3aoCpvVcFbiHd+dC0VLsTYtKjmTx neRf/X34KaTKovaOgSq28SrqTdgVbJmtAdLl7vNSy/IJ3AaGEJ0I29yjPHUqj4JdgN3o zziw== 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=qbLxNx5ZTLFtJfBmyYGqFUyF5NENfzsiaOtRcsrhjlE=; b=aXNcQQ99CZ/r5cOHDhFhzwyGSA8pYLYnsy9e0/MU21ohnlbFiNwgMjw5wMNAlqrM63 TtogqBdGiQC0cRuZ9kQq15K+k0bLrst1ihQTuQOq4LZ1pOflYuk72cVB0Qe9jNceQ17N JirGLkyeiZxZFTb3rzu4Nju1nGpqy8Ff0NweYTdP9O2+eFCiIM8zVnCY7HV7dJqzGoz+ TmRQ5IhqmumwW4WXyDR1oD+e2q64k4EaGI8rJ5iRlErzhwGkvZieYeavnW03Rkdsi7s3 WGTBRndgtBFpIo6QI5EbgCPHzt1rf6GyiFPt8E5C/V45CeVOot06zAjmpWqiS/Uwy7oJ CKkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=o3OQkgZg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a638c44000000b0052c27a0125bsi7843347pgn.738.2023.05.08.05.06.26; Mon, 08 May 2023 05:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=o3OQkgZg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235621AbjEHLXR (ORCPT + 99 others); Mon, 8 May 2023 07:23:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235577AbjEHLXL (ORCPT ); Mon, 8 May 2023 07:23:11 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C6A394BC for ; Mon, 8 May 2023 04:23:07 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id 3f1490d57ef6-b9d881ad689so5828516276.2 for ; Mon, 08 May 2023 04:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20221208.gappssmtp.com; s=20221208; t=1683544987; x=1686136987; 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=qbLxNx5ZTLFtJfBmyYGqFUyF5NENfzsiaOtRcsrhjlE=; b=o3OQkgZgD/WY9opGNlHlsV4/NU2A5cemEhoLcU5WNR34kHgn4MxycFAJPhUApExswE 3VDdWdDGvrt5exhYc5OGjXow3Y2ZpU3yFwMQO8qTXy7/1S0d3BeBTdaqTR2lRrbIx4bf TuxY7QBMEKRieP1e1phESc7x4WFJdJUoW5HqYmEvvrDAlRT7/g3Hly4GylD+hhov4H3S BdShWv0LIK/1A5gplQk/7H+sWoTj59hMLNpPUzTUx6kddAb1iLGWKpD0Zg4uKKPcFOGl rEPoIwKvx5HVHOpfSEiEsqLaXAROGTjBVz58Hc8M8gNvakjiyk47Yfh5RPen0HjwJZni /QtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683544987; x=1686136987; 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=qbLxNx5ZTLFtJfBmyYGqFUyF5NENfzsiaOtRcsrhjlE=; b=JS+xVSBkBpCAIgmIorMa+OcNJCD0O7EqjqMjp0R8jRf/XZJPKDsvv9uMT7ClK4gQRS yKC3uk46Bckbl2XquuHr5vFKKtBwiVtCNPTh/g95o8U5pTw+HALWUo3JPGXtIk0hVw/N jFwHLOWjKSkiHQBflBWqu9dOT3qQ4IOdXN+aQCXH7WJDiKY4wjnYmJKd6rJDjAeut2ar KqSRx7fyM2KSlenSr0GxOax836xKS9crI+bZ8Tu+48uJk+8rZRZWaUH72Sc5XWSG+Iia t6bkUw2xtuWUuZY2X/uP8M6fEJ8sGV+dKtz8f6FDL7mIhHB966ptKWTf6jYjkl4ejy9R HbMA== X-Gm-Message-State: AC+VfDwiocc9LWinWMTpjE8y9f5K1NefYhCckcym0RtaHAT57jAAXiWd vmmuEPcOWJwDcqkRiaXB908+Xnga10/23ngUugFTpQ== X-Received: by 2002:a25:4284:0:b0:b8f:490c:a0db with SMTP id p126-20020a254284000000b00b8f490ca0dbmr11124953yba.59.1683544985454; Mon, 08 May 2023 04:23:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jamal Hadi Salim Date: Mon, 8 May 2023 07:22:54 -0400 Message-ID: Subject: Re: [PATCH net 1/6] net/sched: sch_ingress: Only create under TC_H_INGRESS To: Peilin Ye Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Cong Wang , Jiri Pirko , Peilin Ye , Daniel Borkmann , John Fastabend , Vlad Buslov , Pedro Tammela , Hillf Danton , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 5, 2023 at 8:12=E2=80=AFPM Peilin Ye wr= ote: > > ingress Qdiscs are only supposed to be created under TC_H_INGRESS. > Similar to mq_init(), return -EOPNOTSUPP if 'parent' is not > TC_H_INGRESS. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Reported-by: syzbot+b53a9c0d1ea4ad62da8b@syzkaller.appspotmail.com > Link: https://lore.kernel.org/netdev/0000000000006cf87705f79acf1a@google.= com > Signed-off-by: Peilin Ye Reviewed-by: Jamal Hadi Salim Acked-by: Jamal Hadi Salim cheers, jamal > --- > net/sched/sch_ingress.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c > index 84838128b9c5..3d71f7a3b4ad 100644 > --- a/net/sched/sch_ingress.c > +++ b/net/sched/sch_ingress.c > @@ -80,6 +80,9 @@ static int ingress_init(struct Qdisc *sch, struct nlatt= r *opt, > struct net_device *dev =3D qdisc_dev(sch); > int err; > > + if (sch->parent !=3D TC_H_INGRESS) > + return -EOPNOTSUPP; > + > net_inc_ingress_queue(); > > mini_qdisc_pair_init(&q->miniqp, sch, &dev->miniq_ingress); > -- > 2.20.1 >