Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp925160lqs; Fri, 14 Jun 2024 09:23:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXupxRXmBEPH/+IVhtY/iaY59EjdTTvMF8LcjorUKQbgAJvtQWBwee5M4m8saNxp0WHHzg/ioI2WGC/CAebbbzN+Ad9ptMfG2pn2T9qMw== X-Google-Smtp-Source: AGHT+IFe03Mcvsna0T83CR9ew067A8HptygTSmh7sFZOwVooJbk5zbT8FH4ybXVzhFC0sL7vEQqZ X-Received: by 2002:aa7:9e90:0:b0:705:d78a:2498 with SMTP id d2e1a72fcca58-705d78a3950mr3041087b3a.4.1718382182652; Fri, 14 Jun 2024 09:23:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718382182; cv=pass; d=google.com; s=arc-20160816; b=W02O668CILP7CTiu3LMQoGThrDl36zhxAtgBvKjj9KuueIT2oy6RoT1Z64sJHpoWpc pSibMckQuwNwQQyMB3DhOpaeRjS52uOh3FcugH4K8a0zMEU5T6P4HEtkUYKsDcJfybqh V7qpnrUqdIBkWrd5pgMcqK6gwgsfwLgjvkBIYB7cvWp5vlN1fD/Po/YWV0dwsx/L8k9o xb+JNxajGVkCeTYYrXg7VfXCW/WtFnRcyQH3QKiblF22Z++eivLXOPtQhyygt7EqqvLs 5OIY60INr8oF9Eyazdq76qnZ2uzG+RF6IGxG1IdhPpKr4yvMDJ3N1h5noZCWsjP59MoS rWfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=HH66qDF7GWcMmMf4y8Y1JoXkk/KQutuhkZaxUXORmL0=; fh=aNpJnkL+5x33tO3ZtY3wcT/7GjOwKD8qrwo9CUTpFnc=; b=i5O5fAYtW4DGJ6TQj8L60nLQXbpR+L4ukcNGdHCvhYXkzxFliLf2I82aAwR7xVOGGw 4/ccJVwbgYB3TROc0FdTnhFqoqoc+IH+OiFvsxRbbl5+m+0Ig/mm/aX5RZhFFZA+6Ijb QyLq3lzQKwH0RD2r9SORnBpjZGD4/QXWG0alDqamvXVUCveQ2Msksi99+B0qSTwAenHK dI63E3EW49f1MEXn5BjzzVh6YI/o/s9SQgix/QAn1A4bRfEps/Uw7s0WFHzhh5CqveVW t6asHqWyoU55o/7SSN37zbRrhtVnc6Lr1ytbK7hU/L69l7PzYafjZsfuTHCgOQFTQy7W eTrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=hArU+Bgo; arc=pass (i=1 dkim=pass dkdomain=mojatatu-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-214871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214871-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee65ceac9si3724389a12.794.2024.06.14.09.23.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=hArU+Bgo; arc=pass (i=1 dkim=pass dkdomain=mojatatu-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-214871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214871-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 56532B2528B for ; Fri, 14 Jun 2024 12:13:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02792198E7F; Fri, 14 Jun 2024 12:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b="hArU+Bgo" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80AC0196D99 for ; Fri, 14 Jun 2024 12:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718367195; cv=none; b=FUaU/uebkaz11HFEwYF6Wk/FvzL0gHvr9V2jdQK75Qsypw4+GKmtHDeyJfZVLt4WhU9SYM4aI2/cYdkQmy1/WU3J8FF4S602NJboaQTwbQoG5BSQMdzREw79T2lzDC5l7e37Bw1w6KixM1rtayaiGTDNsFNp9HqAc/sZwlE2rD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718367195; c=relaxed/simple; bh=lL5yo5qqDaKurH6U5U7Fp28JXI5DPylMtIqXyKbjXCs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P85x7CNx98bGSE67iE2FgveDOVphmVdRz+InqiMpXbiHwssqMChNykp/6CphlBuddmSuNnmqvWrx6d/RzMoap1N2xEDrtJ7Etxlws+ugNukywj23wYmsJ3IfGM6UfCRQWDNtRZGuOdCJu/N/SCtrEzMmsAOhSZ3yyye2uEKYWMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com; spf=none smtp.mailfrom=mojatatu.com; dkim=pass (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b=hArU+Bgo; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1f44b45d6abso16860555ad.0 for ; Fri, 14 Jun 2024 05:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1718367193; x=1718971993; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HH66qDF7GWcMmMf4y8Y1JoXkk/KQutuhkZaxUXORmL0=; b=hArU+BgonqGoa1Ade/lbY8lr12qDt3TxY9GKZQyiqGpV7+5llcnu+eZTCN6ktX+Mmb mrDwS6SuLmaSzMaQB2Qwjr8nkrZeqeifrFc+DnM7knHAvAjnvjZccA/u3vRKuUeKeSu3 yC6KDKkGodOF9gCTepvP2vv35+seMuCxNHhI5vkkELsX3GsnQHNCFHPes1yYjRkp4ygL YJF6fQ9o1JKJ/RrC4ZDZV8maYFnowA32ZOJa78YM0IrmIzUludwrNoUu4CFnL9SalpEn noJ1pAcUycv7f1IMlvjssGSKzJxj8iJEDTo2lN73C10hHfi0c+94/7LZ0k79pxJpSiH0 aArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718367193; x=1718971993; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HH66qDF7GWcMmMf4y8Y1JoXkk/KQutuhkZaxUXORmL0=; b=EO3nVjcQswJwTMS7BvVKigzPTVXDC7Wr9HuL/7ejZnzGFFUEQnupAXQPQCKkybybsW ZGYvoHwft3JJ/PUVJLhVrFasVcRSIddQ+J5m1rbzTaygNAvXtz1IG5ITrRJPKBxI/k/f GMC6r8rBLyfdueVB/KmCX7foPVAFLe2Zk3rKUjJzSspcehKVlHIre2jcyukuNueViJ4C /3JWoAULwbJ5gOH4UhJpuCWNGIAP0DSIk1fKnn00OkihEXUlUnf2LVdU1+tb7G0+Et5N jYR5EslQVBqdx+aELLXKVUWHiak5uF3OunbU2oHuFXOQdjUPh+W3dCAKa2lBlCT+MdcU ElgQ== X-Forwarded-Encrypted: i=1; AJvYcCXEkO292SaWc8r5uchfY4OXsifpY7dMkzmj7K/TAlHpTMUqWw9L63C4GXdITyw0/SiPI1jBGc75HyGl2df8lRWJ4xcF/1RPHErcTxd9 X-Gm-Message-State: AOJu0Yze+srnvFeiBt62MoskZzpDa2W8imbyEUTd8NrPPySkK9KUZKvp s7moenn51QAIggZ9v0mLTRYqCeWbQ7G66FK34iSwB8okVM5h7TeQfPr//ngcAnTWH6BpCM5vKWY = X-Received: by 2002:a17:902:c404:b0:1f7:2135:ce6d with SMTP id d9443c01a7336-1f8625cefd1mr33743035ad.18.1718367192746; Fri, 14 Jun 2024 05:13:12 -0700 (PDT) Received: from ?IPV6:2804:14d:5c5e:44fb:3a42:c007:5df5:153a? ([2804:14d:5c5e:44fb:3a42:c007:5df5:153a]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855e706adsm30937105ad.86.2024.06.14.05.13.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Jun 2024 05:13:12 -0700 (PDT) Message-ID: Date: Fri, 14 Jun 2024 09:13:07 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [net/sched] Question: Locks for clearing ERR_PTR() value from idrinfo->action_idr ? To: Tetsuo Handa , Jamal Hadi Salim , Cong Wang , Jiri Pirko Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Network Development , LKML References: <8d61200a-a739-4200-a8a3-5386a834d44f@I-love.SAKURA.ne.jp> <522c0b17-c515-475d-8224-637ca0eaf6a2@I-love.SAKURA.ne.jp> Content-Language: en-US From: Pedro Tammela In-Reply-To: <522c0b17-c515-475d-8224-637ca0eaf6a2@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 14/06/2024 01:00, Tetsuo Handa wrote: > On 2024/06/14 11:47, Pedro Tammela wrote: >> On 13/06/2024 21:58, Tetsuo Handa wrote: >>> >>> Is there a possibility that tcf_idr_check_alloc() is called without holding >>> rtnl_mutex? >> >> There is, but not in the code path of this reproducer. >> >>> If yes, adding a sleep before "goto again;" would help. But if no, >>> is this a sign that some path forgot to call tcf_idr_{cleanup,insert_many}() ? >> >> The reproducer is sending a new action message with 2 actions. >> Actions are committed to the idr after processing in order to make them visible >> together and after any errors are caught. >> >> The bug happens when the actions in the message refer to the same index. Since >> the first processing succeeds, adding -EBUSY to the index, the second processing, >> which references the same index, will loop forever. >> >> After the change to rely on RCU for this check, instead of the idr lock, the hangs >> became more noticeable to syzbot since now it's hanging a system-wide lock. > > Thank you for explanation. Then, what type of sleep do we want? This patch should fix the bug: https://lore.kernel.org/netdev/20240613071021.471432-1-druth@chromium.org/