Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp281359ybk; Tue, 12 May 2020 23:21:21 -0700 (PDT) X-Google-Smtp-Source: APiQypIOwBpcd2xBOzp2NQtC1HFY0WgLMK6S0TCIF0dd08A5NG0Auq144mOd7S3+GIH3tX8D3BBN X-Received: by 2002:a17:906:4993:: with SMTP id p19mr19991732eju.67.1589350881727; Tue, 12 May 2020 23:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589350881; cv=none; d=google.com; s=arc-20160816; b=lo7vJs75WciCB5F1QBtwt7BpVl0a2ItEB0DUlUj+GKTEmY4VyCvDSs3QsT7/uboHYf /xmY+dCT42c8lydi84sjYvhPjp+cBUlGt4Y8MeUItybTBE7d3b0VoswP6Rfk/8eOT947 wvCNN7ujFORO9FnB7YfEIKY3wOZnZuPp2P11KONQB8bQzEAJYPHNBMmIOOW5KoNMysBb nTevkBuZV+eYEKTWPkeTzZj20bAJuKqIat2LihMnnD1Egqki9sVEWpinbd9qjAwtqCyn 935NFQDRVCCo5jneEAH8DZEklHpRVFdx2jVl4IEKqr+CM8YcrghUNPYg+gAyiqJdMsf7 9ObQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=4P7Jmu1wB5Ll0AGHsZRpAyAy8TKotTUse5s5Zg+TmsY=; b=C9WPqLOWsn4yk9jzTZm+i8JvNeUPGscglAkmEYWrngoRxL4D6QUqK5cr0hG8OzkHnv 5ImTCq/AJNdvj7dP0Jdc0Hyg9K+mcOCJhlO1DAc1wC7wbJ6ZQOtFOrTRw8iRGpHPyqoE xpw7M++qN5yGMt6q1U8jahyfOxi9a4U+fL7gJizheGxNVCk78fGR8IPNdB8aNTRCxonM COnPdoSI8u+xS0uWqZHVnsrTEOrSBGrfEDSFV9mowpenln67jGWkVIisUA39lcY7XdQq 4tsy7KnbkRxg4IXLWyVQmIhBFYeYn7ESfCGMM9hyraoRMfjHSG+xsOBmUo/Zii68iGXt b88A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ntcO3ZNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si7037056ejj.109.2020.05.12.23.20.59; Tue, 12 May 2020 23:21:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ntcO3ZNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729434AbgEMGQe (ORCPT + 99 others); Wed, 13 May 2020 02:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729339AbgEMGQd (ORCPT ); Wed, 13 May 2020 02:16:33 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C662CC061A0C; Tue, 12 May 2020 23:16:33 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id m7so6418368plt.5; Tue, 12 May 2020 23:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4P7Jmu1wB5Ll0AGHsZRpAyAy8TKotTUse5s5Zg+TmsY=; b=ntcO3ZNRqNCj3v306aTURqjC4SXZM/QXdc2XY2xkEZc8bGy2d48bEYCC4VJU2IuPam 4vLUgbLQogoqUNP3I8cKjsePXH5zCLgDqN4pEYZSDBCAAID03QYsNadYKCYvY/wZFCaL wb5TKHO5oJr8DPTkj/4J4UvzVw2J0GF2PUMb2jtON5b4KNl8p1P0vEAo5V+eUC/fqrJ8 kFLF9qhBOqGEHDx6ZS5mOVHGnfWGYeLUltI7BJ02RGJ7FCBM8J953IhuWjHRadAY1c4x 1p0L0thKV+Vz12jMAj5ZzlvIaYZZeR5vQs3E5eQZyMZtxF1cPV2meoMo5Wumhlze0pO/ Mmhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4P7Jmu1wB5Ll0AGHsZRpAyAy8TKotTUse5s5Zg+TmsY=; b=FUAUbQTITr1ZurJJg5NIrunl95SCDl1kEQioootALAQZGmO3IqyrIqtxMvsJhMQv9i D4buwi4jCP1ZtEYxR+Uu/dh7Q2qquCml1PpHtvIbQ24SNWaAzRGCW/0ysHpyeKOd7tgG uHaFmG7QFunt9EzrVQVgJw4Y9weTRI25SqTiBEXlwTsELzfjaIupIdTpfN0f+09wPkte SgM80Tw1X1XUXGoupaPDrzAeKRcfB25WjUnErncih4Bz3BmheqtM47WZ6864TbF1Gfof K+Mf27XLcKtm8yZS3GZ9GY5D0Yqv8bY3Tw0jrQjMxAjeF9zjitwVQTEaQ8xJMyOmWiVU Bh/A== X-Gm-Message-State: AGi0Puas3xmQUT/iUtfep0z+35jm96YxWa1TuE0URparRlITqBh3Sh36 W3lv9R5bmuEOQFsT0uP8dg== X-Received: by 2002:a17:902:ee15:: with SMTP id z21mr22649386plb.71.1589350593171; Tue, 12 May 2020 23:16:33 -0700 (PDT) Received: from localhost.localdomain ([2409:4071:5b5:d53:89fb:f860:f992:54ab]) by smtp.gmail.com with ESMTPSA id b8sm13262212pft.11.2020.05.12.23.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 23:16:32 -0700 (PDT) From: madhuparnabhowmik10@gmail.com To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sfr@canb.auug.org.au, frextrite@gmail.com, joel@joelfernandes.org, paulmck@kernel.org, cai@lca.pw, Madhuparna Bhowmik Subject: [PATCH] Fix suspicious RCU usage warning Date: Wed, 13 May 2020 11:46:10 +0530 Message-Id: <20200513061610.22313-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madhuparna Bhowmik This patch fixes the following warning: ============================= WARNING: suspicious RCU usage 5.7.0-rc4-next-20200507-syzkaller #0 Not tainted ----------------------------- net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!! ipmr_new_table() returns an existing table, but there is no table at init. Therefore the condition: either holding rtnl or the list is empty is used. Suggested-by: Jakub Kicinski Signed-off-by: Madhuparna Bhowmik Signed-off-by: Madhuparna Bhowmik --- net/ipv6/ip6mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 65a54d74acc1..fbe282bb8036 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -98,7 +98,7 @@ static void ipmr_expire_process(struct timer_list *t); #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES #define ip6mr_for_each_table(mrt, net) \ list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list, \ - lockdep_rtnl_is_held()) + lockdep_rtnl_is_held() || list_empty(&net->ipv6.mr6_tables)) static struct mr_table *ip6mr_mr_table_iter(struct net *net, struct mr_table *mrt) -- 2.17.1