Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1595877rwr; Fri, 5 May 2023 17:18:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LZVlvu7hunjjRz9HcyUKA6HGhaO3BEyT4lFJ7atG/PueKmhrAJyGy8R2+T5tDEBaX0vtu X-Received: by 2002:a17:903:1c8:b0:1ac:2d81:3cf2 with SMTP id e8-20020a17090301c800b001ac2d813cf2mr3714254plh.58.1683332324156; Fri, 05 May 2023 17:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683332324; cv=none; d=google.com; s=arc-20160816; b=idTgSYY+COrrJPu8GCXNb0yMlL0nh4WZB20yAodfQRBCmta/BgcDRrIgpzzgrpuRqw kCVWjmrijRIP6BxpEe/PQnLNdsxXKEj6fbx1hZ16HtkyHRvl019b7GyfKysfq2znkodh /qsVA6+5aRhpAUEuHvC3ofo9W0gsNiDnEtZjJeBBFp8toiv6GUjJnsbH80zY3h5w35/o HGlwVVTuLC2RKEI5EBDaKjbdsPloUVfthGI0ecQrMO62kT63K7tOTXJb0MxYZUApLbXr OvRRSGcKYfrT9+C4iTDNj6zZRqCvrKLbNgcKW6FwGnP7a8hP30Ldwv0bFhzuDXZbh+RP 5dCg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z1tFG7m2xfEcAcR8LZf/choHnP0WMR/Vlxqt/wj5I9k=; b=rB9/wneJjrsRv+mtM+/y6FrTGq3MH24UIdl90KMAMDUqyk4xyARrA2akeEOpv83i7V 0CWXvdMa20K1bEnXn6r623ynykCAectU2VntITl8qZl1zYDPV970gTvcRefr6aSmjQgB 14/UcvhkpM2yPyFxeRgNomVHghKyiwor6XpLircZzprYSV6rUyUPzTj0CBb3yYmL9pD+ c1he9KYvE2Fh6reSEkARI201rCRFCYiBvWynZnzXHfVHCx1XxH8PMeMAiU1QQxoD1hEd OMCwWeHPrHvzNPTdlcwKXnJLQ4+GanEoSqtQ8AwqWBxsFnmcyu6IUwcdJXmeSPFHPbY+ ngUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Y1BAYKAZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a170902bccc00b001a878485664si2656154pls.318.2023.05.05.17.18.26; Fri, 05 May 2023 17:18:44 -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=@gmail.com header.s=20221208 header.b=Y1BAYKAZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbjEFAKG (ORCPT + 99 others); Fri, 5 May 2023 20:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjEFAKG (ORCPT ); Fri, 5 May 2023 20:10:06 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D6B65AB; Fri, 5 May 2023 17:10:05 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-55d2e87048cso35886777b3.1; Fri, 05 May 2023 17:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683331804; x=1685923804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z1tFG7m2xfEcAcR8LZf/choHnP0WMR/Vlxqt/wj5I9k=; b=Y1BAYKAZPrs/r9CdIQJ4lL/ATT93ESaJ8SStXZHLiUp+eEJBc2P5/x3DKuJE7NzV8S kKOkQMinSf9ffc308+ftL8tChQaEUlc3j/Kz1+Z+rLDFdIx67rQfrLbQN+DK6Jw9E/hd DCfG7flWsAAAM94A9upHXkqA1AskeBXV33AZfpZS5v2S57gNP1cSLOOd+9b3wb137WXU a+nDr9lxYBJdrV9Gx2psyMth769F7G1kdwHhVJuRmzemZa1FkTodLXXK1T7jMMeZDana OgdcoWkhFQjyQ7AFMlSty+/XF/W0lgMl++5giQjyzKMddV2DfmitZryrMTxwa45sx2ma QyfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683331804; x=1685923804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z1tFG7m2xfEcAcR8LZf/choHnP0WMR/Vlxqt/wj5I9k=; b=bq1evU4xMIiqGyud2Uv2Xs6UT+QfmRg0iwsbxD7acMf920NiF9Brev1gdwGnewh4QK cWha4Wzl7ZV1d+dgFBUhKaxO3Oi9Ubvl67F4b+EskG8c5O84yeH+QLB81/Mwb4a/oGT0 W1bge7wPvghVGwJNgQK9apYF5fDOcTPGj4R4gvaSX9e5cFSawHSkGwHc5FrMofU+9HXm EdFL4wvIIZyIqE6Is8Q0G5P2jv7+iUj/2Cn6HiDu/WVIK7qzGKBEDdwq3pGqcxEaW7aj NXquB0FrKB6gV74jYK92aH1l1bsJxNtHJhwUPMYNB9/lg80hCzEO6xPpi1AaJhOElayp J5MQ== X-Gm-Message-State: AC+VfDwh3LLSicJl3PKCcjnVaipyVTBlNYHQFyP2xa6d16EJykxShfBz XNcaHmn038lOytm6+l3o1Q== X-Received: by 2002:a0d:d703:0:b0:55a:8b02:1d8f with SMTP id z3-20020a0dd703000000b0055a8b021d8fmr3411898ywd.49.1683331804016; Fri, 05 May 2023 17:10:04 -0700 (PDT) Received: from C02FL77VMD6R.attlocal.net ([2600:1700:d860:12b0:5c3e:e69d:d939:4053]) by smtp.gmail.com with ESMTPSA id h188-20020a0dc5c5000000b00545c373f7c0sm791849ywd.139.2023.05.05.17.10.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 May 2023 17:10:03 -0700 (PDT) From: Peilin Ye X-Google-Original-From: Peilin Ye To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jamal Hadi Salim , Cong Wang , Jiri Pirko Cc: Peilin Ye , Daniel Borkmann , John Fastabend , Vlad Buslov , Pedro Tammela , Hillf Danton , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang , Peilin Ye Subject: [PATCH net 0/6] net/sched: Fixes for sch_ingress and sch_clsact Date: Fri, 5 May 2023 17:09:39 -0700 Message-Id: X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20230426233657.GA11249@bytedance> References: <20230426233657.GA11249@bytedance> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 Hi all, These are fixes for ingress and clsact Qdiscs: [1,2/6]: ingress and clsact Qdiscs should only be created under ffff:fff1 [3/6]: Under ffff:fff1, only create ingress and clsact Qdiscs (for now, at least) [4/6]: After creating ingress and clsact Qdiscs under ffff:fff1, do not graft them again to anywhere else (e.g. as the inner Qdisc of a TBF Qdisc) [5/6]: Prepare for [6/6], do not reuse that for-loop in qdisc_graft() for ingress and clsact Qdiscs [6/6]: Fix use-after-free [a] in mini_qdisc_pair_swap() Please review (especially [6/6]), thanks! Other tasks, including: - prohibiting sch_ingress, sch_clsact etc. in default_qdisc - more cleanups for qdisc_graft() Will be done in separate patches. [a] https://syzkaller.appspot.com/bug?extid=b53a9c0d1ea4ad62da8b Thanks, Peilin Ye (6): net/sched: sch_ingress: Only create under TC_H_INGRESS net/sched: sch_clsact: Only create under TC_H_CLSACT net/sched: Reserve TC_H_INGRESS (TC_H_CLSACT) for ingress (clsact) Qdiscs net/sched: Prohibit regrafting ingress or clsact Qdiscs net/sched: Refactor qdisc_graft() for ingress and clsact Qdiscs net/sched: qdisc_destroy() old ingress and clsact Qdiscs before grafting include/net/sch_generic.h | 8 ++++++ net/sched/sch_api.c | 54 +++++++++++++++++++++++++++++---------- net/sched/sch_generic.c | 14 +++++++--- net/sched/sch_ingress.c | 10 ++++++-- 4 files changed, 67 insertions(+), 19 deletions(-) -- 2.20.1