Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp545362lqs; Thu, 13 Jun 2024 19:51:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUL5iE0X63ePW+zvqA8wtdH1hmC8kYoq7ZbpPVrEhZ/D15WSqbnxfEr+UArQn1flZYNh+KrS2rSxTZ1zp6SSdmk6/WeqoIrsxobulIX5A== X-Google-Smtp-Source: AGHT+IF+TNKzzzxwWrHj5mmBgaPZKlG2rmRJq7zJI86QDzwDtXMlVxmnw4NltbBQ+O8zReuqBOo5 X-Received: by 2002:a17:906:15cb:b0:a6f:53f9:7974 with SMTP id a640c23a62f3a-a6f60dc511dmr118473266b.52.1718333488000; Thu, 13 Jun 2024 19:51:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718333487; cv=pass; d=google.com; s=arc-20160816; b=UZpDJtraoqr4EzcTucD0fVx/J4qLNm7SCS5aeLSjGqMt1qHix351LUDVYKPh9/4Lhg bD10Z+vWSHYGii3X+s02iwH7TXup2vHXjN3RID9E647gieOw5WF1dJOLErkCFVnPrP0t AU79eV+vAysAnjaKCLgxiv2GOH8kC0SPiGTBh+K2/kc8QMa+tLqIdH+muXqwkK4EAOGQ 3TWvWnG+3uon8PFGSClQZt4faSx7vB2C89umlB4pSgbWu7A/L7WiDHHsF2ybsqCUvBlY M3otWz7cm0iLt+0ydBKMQaAKNweQhlTNPFJwHxqty6b1cKsgfkOfW14WDfV39TPU0GC8 W/ZA== 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=uxSLIdsJYn8L13kFMpqrr8gKJyf66QofWKoZIgr+wgY=; fh=fZwe81Cah8zuVNTroNDrwg0vjXKwiFXNaG8h3zbSYJk=; b=sPBJGNTmv6DEpIWyjxTPXZznjhpuLF9nOxzcmO6lzr/hFIOvHKEBbVjxIEk3YfYFBq 8GEnAOzs+ICtoh3ZYYPtozFULLc8zY1LWpwJETVCBFparYIQFRQbb+ii/vY0f+BR+Xuy MG6JZGIyCg09MuMClwsTnlsbCGLf8KA4gWJQyTtnOiC4zVUp555wfOBnAarqLkjMGnZz PmxEm2oIlstJ6EBeZdCywM/L7veGILclRavra99u+q7iOa1mt6qIA3Y164kl5fa7zRbZ x9hvx1fv/Vqu227KbcYbQGfz1O0t/L/yD8e0TIs1S37HUIEyc18oGjSvBgl0CcwvSkMH ZJhg==; 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=WHL3rQII; arc=pass (i=1 dkim=pass dkdomain=mojatatu-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-214270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214270-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e26045si120871666b.727.2024.06.13.19.51.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 19:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=WHL3rQII; arc=pass (i=1 dkim=pass dkdomain=mojatatu-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-214270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214270-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B44D01F22E30 for ; Fri, 14 Jun 2024 02:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF4B7184102; Fri, 14 Jun 2024 02:47:47 +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="WHL3rQII" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 68A013201 for ; Fri, 14 Jun 2024 02:47:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718333267; cv=none; b=lCADiVV6HF1QJ1/H+T9/VYaI4Mh9Acrk0C/O7CNkrmUIteOC9Q4Z1XLPCprwEoNPminjpykLEraysdOdJfMXADkYInHiUt31DDntb4znxpuXe3kgCEvfFglhPMvOZYso5k8hxKke8SYJw45L5lVCCEazAUX/3JBsEOLfTCdGtN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718333267; c=relaxed/simple; bh=uVZB5kz+WSij71fy+S9z+Z5qsj0MjMMhk1EVCUlnwA8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j5U3KnkMUI5Z4R/ahEQa4AAFaIK3EUJ03iG11tU5syR/1q/l9lG1HjbWr9T2CCiuu8d1RHldmacRicZzPaAglc0LqeOKnOmryle2kfx79j/2ay5JHcZo/Je7PXwJTfHoshifoHKQ28DKqPZlm1qsM14D9kd7BquKvR4sEQrAaCk= 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=WHL3rQII; arc=none smtp.client-ip=209.85.210.182 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-pf1-f182.google.com with SMTP id d2e1a72fcca58-70413de08c7so1279666b3a.0 for ; Thu, 13 Jun 2024 19:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1718333265; x=1718938065; 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=uxSLIdsJYn8L13kFMpqrr8gKJyf66QofWKoZIgr+wgY=; b=WHL3rQII6D97Rc8IB0Tkg/sf9KH0EY5SsngNoCk4w6D4EPurhhqDTzRJL3MMMFXzcR JVgZUWVPNZCSo7GbWWCY5q+AvkSyb7/uwKjOLoK4ma/mS4XMiHUWgzkxOx1hOnlJIf89 p/n56OaoQyNjBLth8QBBzbbEJR4z2Ez0zgSmgZfDra3QLaC+z+az79/hx5uYV67qZPEV QUomIWwB3NOeEQE5N67I/AA7IAdq19wjxt9/u/NV3BdM1rqmPoEglwZoa7hT99rPoHoy snqCUezjM9YfsATEtfFIJxCSXlInUs4TK7UTqdDPyM77enkIr/D8nPeOj9isCq5R4FOy 45Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718333265; x=1718938065; 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=uxSLIdsJYn8L13kFMpqrr8gKJyf66QofWKoZIgr+wgY=; b=N1mrzpCah7JzNCjc5pvG0MAzus1RvvwoqXLoGOf/MPPVaPRxA4P5UMUm5c1XHEB+2v IoaoHYAXVjLFrt9kouCjGA8QjcU2wlDwctS6XYVymc4zvEtaHYQLIaXYq2Nc3B4LTkQN lDUOtZrZ196RzDfTQHtWCexEq3Okteu0rAT6Dn4Ui3afBFzPr3uWkIXcAVYijRBWR1SW AxO1ibyhyF1cpmEIHUF0y3wgwa4zsGG/HHiRs7Er+LFyy3PzIwTDu6LJDSL7UDim7QEb 8iVA/9UBn2Sef/i7Ipude7ddTXmEHKJcxb9DCmtFBw49lYJoOuyB8rEw8a4uaTAOF0KT /N8g== X-Forwarded-Encrypted: i=1; AJvYcCVJJjHA2UV0Fm2/X8lR9ZYGaRuQp8DUtJru7u7qNRzaDruHPVTEa6RrgzvHd++1adEz8bg68nNEN0wvp0eOu1vB5DvWf8Y9DQ+QUZCP X-Gm-Message-State: AOJu0YzTmObIvHdofkXbzrgv2VgOmg/K8Zh+bUIfqXha+RTDUf4vuoa7 NT19dTRxPXlXemFGYf7FkEZcWBSCcj9ljxAfILeAWYLrG6qHTVozEIEtAVYyxw== X-Received: by 2002:a05:6a20:8405:b0:1b2:b220:2db6 with SMTP id adf61e73a8af0-1bae7e22a62mr1754652637.6.1718333264722; Thu, 13 Jun 2024 19:47:44 -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 98e67ed59e1d1-2c4c45f7840sm2567380a91.32.2024.06.13.19.47.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jun 2024 19:47:44 -0700 (PDT) Message-ID: Date: Thu, 13 Jun 2024 23:47:38 -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> Content-Language: en-US From: Pedro Tammela In-Reply-To: <8d61200a-a739-4200-a8a3-5386a834d44f@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.