Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4016454rwd; Sat, 10 Jun 2023 21:43:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kt6NpUd7hrKEopu1IDOx7xrsJFtKaCXiwvR+oCwro+y3mMSEU8kK2TJAzIQYrwZkttgQ/ X-Received: by 2002:a05:6a00:198e:b0:656:c7b2:876f with SMTP id d14-20020a056a00198e00b00656c7b2876fmr7619017pfl.14.1686458582798; Sat, 10 Jun 2023 21:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686458582; cv=none; d=google.com; s=arc-20160816; b=JCZt9qoBdLzTzds0F6Pv5sTglCpV/ubafq5gXyd9eCT7rOwkyiniEcLZw12W+kL98g 8UQQjl+F/1P2nFIYfBK6NENzhNRZp5DC54DBLKjb466t+SoCtwbnTnTYsyryIbklRKPx a1r0PIGs5TyaJc4ODAr0JWAXRHD8Wj8hje6lCsWah3zuD1EvG3lrDLSenUJ3wzqugILu vWgNMeyT4igYLbEqwrvkWTV352AiHxwzZl70mh6PeHUdJaV56WHlY95sliCnyGeZpsI0 h3PFJuCv7uGavMfWi7eFnQC9lDaX2luOOz5Teql0bbH9uIVkcv9Wv+j/Js2Yb39iolEL CAng== 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=rdbwCfJP0fRhUMDyPqmQQA9434sxRWUVYDLaUn3QYpA=; b=RHh38b+fJE8yM5Q6JV2KVJsdPZDsEkEeus8TJr15Ym05GRnTp64eTlLxhRMpl/jnYv jb5fxTJzUj8kh2OjZiDkYPMJLjeQGnfXt7Q5xadp6ewGL5qnK/gIvnwBlbXXnlXSG6E7 JFIvylPUyuNCupQgJ9uhsVbptwv9WTk3yOWbx+3aockUjZ8+zbIXK7/V8pWJBjYdRSDQ z7UA+eIyXLXYPEUlNp2ckUDiSzWdnsJQKqZTE90n2gl/ZAyUw/EeMJSjHKyZ0N2I2g01 3E3r15Fwxdljg67+klUw2MoPMvbBkkRdoOUgrtgTy0j0x1lPbtWUfuuFOxS80ZttATKP m7gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=JdBnK8RW; 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 y2-20020aa793c2000000b0065121dedaefsi4877694pff.339.2023.06.10.21.42.51; Sat, 10 Jun 2023 21:43:02 -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=JdBnK8RW; 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 S230515AbjFKD35 (ORCPT + 99 others); Sat, 10 Jun 2023 23:29:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbjFKD3z (ORCPT ); Sat, 10 Jun 2023 23:29:55 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5046B131; Sat, 10 Jun 2023 20:29:54 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-75ec6ae7ffaso245187985a.2; Sat, 10 Jun 2023 20:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686454192; x=1689046192; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rdbwCfJP0fRhUMDyPqmQQA9434sxRWUVYDLaUn3QYpA=; b=JdBnK8RWMwzM9FvTKYnYU+l7dKyIDGgBpEb3IuWMGMH04P2z4usCkiYHF1tMTv5Rqg 9vy4dOVceZKFjtG9CNMhAJdslHedaYg55wn/0C7oEC5bBxAtySJCNJAPaZWSmErOuNpy k8jbqiJKgboR0rrs8csVBBaWte0CXjUGvwXxXG3Ry4AgFYxVWYKsdJ79+ryIHs+L8Gn0 36nVxTtAQ/SCmFV0wyZr9kRFlNj2tNj5N/Z7AD3tpEqnHdoEfJvffT/nZB+fSzOtKVNe uOHpfppr4QEGaoUpZVSq7S4FlSOyYJlMD867EBwuMLhBHOaIZMnEIYR1SjcFEMwwCTfx +X9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686454192; x=1689046192; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rdbwCfJP0fRhUMDyPqmQQA9434sxRWUVYDLaUn3QYpA=; b=kGUyZ5YbjyaLx5KBSr9ttbdCziwxZsEbjXtdDr1dZltPk/SUG4ALfO6Axae1Z4YY3C Xq67PJsKrwGv6SgGItO3XawhfrBEliUJ9X2m8EP8tGW/wnFTLOin6xjVqvcTYPQY/y3Y oRAujBRaXX5tTHAV7kAdL/7UMpo0kY/PvAtJQOcC57DOY8IDsB9LZ+DZSt4xP0UMj6j5 X+QNoluDPRaElrV00zZvD98ZBKL+F3X41ud2KAeNOWwBEWglB4s9CbUBpEFm8aKAwcQS pKItXZtczn+oUWQSc7APLYFrROb8qf7u+HSPktHhTRGO1u05TO57w6nwk+a8A3yns/3b qRBg== X-Gm-Message-State: AC+VfDyjFyOw6K71AllXX8lmoO0ZZVW+VzWi0s2OG9hbs6rp1m+a86To drygfhdwWUWS1lZuLP9xxQ== X-Received: by 2002:a05:620a:8c90:b0:75e:ba84:ecca with SMTP id ra16-20020a05620a8c9000b0075eba84eccamr5396290qkn.40.1686454192214; Sat, 10 Jun 2023 20:29:52 -0700 (PDT) Received: from C02FL77VMD6R.bytedance.net ([2600:1700:65a5:6400:a53e:60df:7509:de6]) by smtp.gmail.com with ESMTPSA id c16-20020a05620a135000b0075aff6f835bsm2045161qkl.19.2023.06.10.20.29.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2023 20:29:51 -0700 (PDT) From: Peilin Ye X-Google-Original-From: Peilin Ye To: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Peilin Ye , Vlad Buslov , Pedro Tammela , John Fastabend , Daniel Borkmann , Hillf Danton , Zhengchao Shao , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang , Peilin Ye Subject: [PATCH net 0/2] net/sched: Fix race conditions in mini_qdisc_pair_swap() Date: Sat, 10 Jun 2023 20:29:41 -0700 Message-Id: X-Mailer: git-send-email 2.30.1 (Apple Git-130) 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 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 2 patches fix race conditions for ingress and clsact Qdiscs as reported [1] by syzbot, split out from another [2] series (last 2 patches of it). Per-patch changelog omitted. Patch 1 hasn't been touched since last version; I just included everybody's tag. Patch 2 bases on patch 6 v1 of [2], with comments and commit log slightly changed. We also need rtnl_dereference() to load ->qdisc_sleeping since commit d636fc5dd692 ("net: sched: add rcu annotations around qdisc->qdisc_sleeping"), so I changed that; please take yet another look, thanks! Patch 2 has been tested with the new reproducer Pedro posted [3]. [1] https://syzkaller.appspot.com/bug?extid=b53a9c0d1ea4ad62da8b [2] https://lore.kernel.org/r/cover.1684887977.git.peilin.ye@bytedance.com/ [3] https://lore.kernel.org/r/7879f218-c712-e9cc-57ba-665990f5f4c9@mojatatu.com/ Thanks, Peilin Ye (2): 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 | 44 +++++++++++++++++++++++++++------------ net/sched/sch_generic.c | 14 ++++++++++--- 3 files changed, 50 insertions(+), 16 deletions(-) -- 2.20.1