From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50033C433E1 for ; Sat, 16 May 2020 07:45:29 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18199206D4 for ; Sat, 16 May 2020 07:45:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mP01c83a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18199206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D466988E94; Sat, 16 May 2020 07:45:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uL7znvQcdHp3; Sat, 16 May 2020 07:45:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 6685588BB7; Sat, 16 May 2020 07:45:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5CC3DC0865; Sat, 16 May 2020 07:45:28 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id E6CF2C016F for ; Sat, 16 May 2020 07:45:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E1ACF20446 for ; Sat, 16 May 2020 07:45:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OpBaNVDZ6g+q for ; Sat, 16 May 2020 07:45:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by silver.osuosl.org (Postfix) with ESMTPS id 4EBE220425 for ; Sat, 16 May 2020 07:45:26 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id t11so2139334pgg.2 for ; Sat, 16 May 2020 00:45:26 -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=QVZpMvi6NwiXQViyAfKl/G+QbYOlYNWFmXEZ+j2oOkw=; b=mP01c83aDSBG6fX2Tqtxc3xSgcasY22lcRN9/wM3nG4n0vYnFF9sGtt8ViCAzY+TTi RmyV0YsOVeDXxPa0jqBl1C5OdWO6UzdT1RTcfx7r4V68UD8k+UfUXOFtR7kwmvfh1Qmh IH8aCJzjQU+/oJdp5MMo4kbRLOzmAUs/UjlIFPo1OD4ewCuIjv8Ze2pzKOgLAIEOOTWh dqEreBtyNkjGBHx4yIqdKgwKyGR3CjjhOpmrudkLUZYLuRIIDGB63fMyOQp2sqfIdmQG Gr+UGhDvSNU2pMhKFvbpfN5ThKxeNJXVC388UeSXC0HPummmGmVZeuHpF9jBzMNx85TO ppTg== 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=QVZpMvi6NwiXQViyAfKl/G+QbYOlYNWFmXEZ+j2oOkw=; b=SJrkexbZCn32MyIOawp8PqprL/Jb5WwVhyOoxWl6bOW5aHrgjiPmZuOk1Kbu0QauFU TG+LF5E7rNMJwPXcJx6F5nA2hvozHtqzOuogzwRPCgI3vg+6T80Qp/GdbKOXVHae4IXq FOutAeUIXfSVcBFufdO0yk34xfIs3Zfl+UQv3KJ9cLsXy7vQYMCvgcXtuAEJsHeeMu85 a4BJ9oAft3D73qrPwZNAEcWOd5UxL5f+oPhrcxl3ZunmjIt60sHDRqQEM3ZkbKbJSz6p C89A6/dQXM/pCyvcS9BSJ+3jN5Fay7ZtKT1HagOe1VAGoFq/mZzaMqGg+EwwWDXa/oNE wyZQ== X-Gm-Message-State: AOAM533mGttkYDtF9nYcwqpxBGpjEoWYkvCMFvpvZXRXwIFgMu44QDOr 3KhxFlrGrnJtOsHgkCJo+A== X-Google-Smtp-Source: ABdhPJzGf98P2GYAj4or19dQafaRzvKhEyaYKg7bVelbBsUaJ8BI7Vzom8AM2cUFiYSRdPA7rijXhw== X-Received: by 2002:a65:518c:: with SMTP id h12mr4298392pgq.17.1589615125937; Sat, 16 May 2020 00:45:25 -0700 (PDT) Received: from localhost.localdomain ([2402:3a80:13a5:a61b:b5d4:b438:1bc1:57f3]) by smtp.gmail.com with ESMTPSA id l4sm3335677pgo.92.2020.05.16.00.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 May 2020 00:45:24 -0700 (PDT) From: madhuparnabhowmik10@gmail.com To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, kaber@trash.net Date: Sat, 16 May 2020 13:15:15 +0530 Message-Id: <20200516074515.13745-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: paulmck@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Madhuparna Bhowmik , cai@lca.pw, joel@joelfernandes.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [Linux-kernel-mentees] [PATCH net v2] ipv6: Fix suspicious RCU usage warning in ip6mr X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" 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. Fixes: d1db275dd3f6e ("ipv6: ip6mr: support multiple tables") Reported-by: kernel test robot Suggested-by: Jakub Kicinski Signed-off-by: Madhuparna Bhowmik --- v2: - Add correct fixes tag - Fix line over 80 chars net/ipv6/ip6mr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 65a54d74acc1..1e223e26f079 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -98,7 +98,8 @@ 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 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees