From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BAFB225D3 for ; Thu, 4 Jan 2024 14:32:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=idosch.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=idosch.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nhWXa02B" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 134AD3200B32; Thu, 4 Jan 2024 09:32:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 04 Jan 2024 09:32:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1704378739; x=1704465139; bh=vGxhhuGJmBt8A36J1dEbOHdQszu5 76tOBWvPFflxn4E=; b=nhWXa02BJddmMMAqlOZjWcWVghkOF+8dbQMelrlgCCQB YpXd6+bzWcz4opVJs5gzpOsFmRM2hPjkOVDYW9R0cnQ5XKSzQ9/FFh5tmW1fDHhV SAv++yWbpJzNMVJyDzgxAXEZ64N8P/8ubkVppEGHxH2rd5cPqidGtbLEZymQPS0d lHzLHWKfHG9KVDk3hBsa7BcVymC76HF/PHZzW4LdhYxSj7/ws3koSt5znMDiBssw N9TEKlATVsJ2cv7jvn1WDhq20G/V+QuMaoAczjC7F9PHXdtYc7O27V9/BTjnWTFV 9huBzhOwbVEhdmYboO0CE8d2LBvunMwMybTVOLPDzw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegjedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcu ufgthhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrth htvghrnhephefhtdejvdeiffefudduvdffgeetieeigeeugfduffdvffdtfeehieejtdfh jeeknecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Jan 2024 09:32:18 -0500 (EST) Date: Thu, 4 Jan 2024 16:32:15 +0200 From: Ido Schimmel To: Jiri Pirko Cc: netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, victor@mojatatu.com, pctammela@mojatatu.com, mleitner@redhat.com, vladbu@nvidia.com, paulb@nvidia.com Subject: Re: [patch net-next] net: sched: move block device tracking into tcf_block_get/put_ext() Message-ID: References: <20240104125844.1522062-1-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240104125844.1522062-1-jiri@resnulli.us> On Thu, Jan 04, 2024 at 01:58:44PM +0100, Jiri Pirko wrote: > From: Jiri Pirko > > Inserting the device to block xarray in qdisc_create() is not suitable > place to do this. As it requires use of tcf_block() callback, it causes > multiple issues. It is called for all qdisc types, which is incorrect. > > So, instead, move it to more suitable place, which is tcf_block_get_ext() > and make sure it is only done for qdiscs that use block infrastructure > and also only for blocks which are shared. > > Symmetrically, alter the cleanup path, move the xarray entry removal > into tcf_block_put_ext(). > > Fixes: 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra") > Reported-by: Ido Schimmel > Closes: https://lore.kernel.org/all/ZY1hBb8GFwycfgvd@shredder/ > Reported-by: Kui-Feng Lee > Closes: https://lore.kernel.org/all/ce8d3e55-b8bc-409c-ace9-5cf1c4f7c88e@gmail.com/ > Reported-and-tested-by: syzbot+84339b9e7330daae4d66@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/all/0000000000007c85f5060dcc3a28@google.com/ > Reported-and-tested-by: syzbot+806b0572c8d06b66b234@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/all/00000000000082f2f2060dcc3a92@google.com/ > Reported-and-tested-by: syzbot+0039110f932d438130f9@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/all/0000000000007fbc8c060dcc3a5c@google.com/ > Signed-off-by: Jiri Pirko Tested-by: Ido Schimmel