Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp407506ybv; Wed, 19 Feb 2020 02:01:54 -0800 (PST) X-Google-Smtp-Source: APXvYqztj5SvIcyAWTCz6A2JRUPL5WYDNTtV0ihGN/++CIBu3IzazMv1eTTZcieU6XLqRnl0qJL9 X-Received: by 2002:a05:6830:12c3:: with SMTP id a3mr19626884otq.341.1582106514808; Wed, 19 Feb 2020 02:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582106514; cv=none; d=google.com; s=arc-20160816; b=CXnG3Sx2Xb/nCnhtDBtBNd7q1kGZTBBw1ASbjRRjVrYctb9XX8r2mpwhRL4DJe0UQH LpAmlyPb318ZGX1/eVM3tExpu/dVB7NuLr6OnsD9r/TD2ELLOtrAglE7CEQOhXCVyyCj yoEuL+ZfH0xfVm/wAC6P352cnmaeC6Zhy1GMd2w2AMYqt63gSA8sEPPxpvvNCHePjVfs 2IP3fKWE5MSV4l4AMsZobb1yNW2vwuE0KghzLBwY0imdgOWTymtCAa7ZKYokQSb7XYvJ ftjhuswq21EM7acaeDMZ7EYEkWwYgjXcaDPLOYBAUc6ExURI/JGr9MYkgQBnUuta6KMP tNvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1EXylD9M9pyp6RCZrxC0U5DPcWHq62ndaaHnByK73qg=; b=U76icYdF+uwxs6AnU2oD0BeO339Sd706TtlRZA2wuMcyY5lnQuwWCDii76M+X51Ets 6Ne2EULlpQlE3Wm5vLHpMiO0wrSTyCl1YiF62hbwwC6cVxXIexLQ53h318Pgfy9/B0uZ oKcCA6OoY6QIupcc5vcKn6f66wfBIbsw2iGg13arVNbhXOT5PfsBUWJJqNBq43BjYgbJ GRdXsH1DRZAyT+pQZQEi2jbtLICeHCQdkWwa2Q1dfcAalWT5DVBOxGjtZT1pacinDlPp EGs3sanakJS6IFJbSxOABFTl1zVEtIFfJgyj3vZIKsKJhbbYA1eQRk7OOgYHcEZbnB/n nDLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="h1LWdc/X"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id k19si872130otp.33.2020.02.19.02.01.43; Wed, 19 Feb 2020 02:01:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="h1LWdc/X"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726668AbgBSKBf (ORCPT + 99 others); Wed, 19 Feb 2020 05:01:35 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:47093 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbgBSKBf (ORCPT ); Wed, 19 Feb 2020 05:01:35 -0500 Received: by mail-pg1-f196.google.com with SMTP id y30so835430pga.13; Wed, 19 Feb 2020 02:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1EXylD9M9pyp6RCZrxC0U5DPcWHq62ndaaHnByK73qg=; b=h1LWdc/XtVhfk8KjtHhg4fU8weGskZPlQRBh5/dxOKJooTKO6sqSyQcabvn/E5pfPB qHxDiS5im9Rv2NXhglKKTBJTlmdcA0rbXMb047X51M63ZYkgcvE0TkwB8AjRTrc7NY56 oMd4FQer5pztQ+WEc5OGCV7FqpisfkCYzn38geyLlsWd3JCFiZ0abJEuKkhqrEVSlEpd q8oxbcP8n7mp0YPGJwVfWvhylm2poJO0QdF06EbcTHUcgZ7PsxE9ZCrwPEDysmzvq5vt sfkfnoppF867VfHRaOASJ+AF7D5p1VcnWpGqyfHIAZkq+YQ3fu/HlP6yIXQ/IPet6sY2 8Ftw== 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:mime-version :content-transfer-encoding; bh=1EXylD9M9pyp6RCZrxC0U5DPcWHq62ndaaHnByK73qg=; b=Kb/aseEtxL/DiKoWClPtk829VR+v0+EJ7QSrG+7dR5u2OOXGyuhBzdAmtQdXrgIVE/ LOiCqQzz2i5KtkvITmEaa6TYlMoZq4opNhr8pMn7nRu9klpexiv8j4pVIiItrNiGBnBM h96Tl987rafVAhJWoB0g/PXIyUuGu83kahb0HNJp7HmQwU/U5Fsq3N6Vt8LSVVYcM+N3 VnWTASb/vKaivKq6qd1mv+wWNAO4aQ8peJ02tRCggdhJ5Ggex5iSQu5m50gLGn3EhQDE DulomWlEZuHRZyDHTAYR1jzFiwT8lCV4tV/MzknISECtA8DEjN3KYlosbYQkWJOab4Kf Kumg== X-Gm-Message-State: APjAAAWFHkK8BrAFibsfejh/7OmcXSFyIaAwBPjSba6sgGFa6sCnAlUo DoZfGP4lSQb4br03nRfIyJY= X-Received: by 2002:a62:ac03:: with SMTP id v3mr25792332pfe.17.1582106494797; Wed, 19 Feb 2020 02:01:34 -0800 (PST) Received: from localhost.localdomain ([146.196.37.220]) by smtp.googlemail.com with ESMTPSA id q17sm2040779pgn.94.2020.02.19.02.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 02:01:34 -0800 (PST) From: Amol Grover To: "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , Amol Grover Subject: [PATCH RESEND] net: hsr: Pass lockdep expression to RCU lists Date: Wed, 19 Feb 2020 15:30:11 +0530 Message-Id: <20200219100010.23264-1-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org node_db is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of hsr->list_lock. Hence, add corresponding lockdep expression to silence false-positive warnings, and harden RCU lists. Signed-off-by: Amol Grover --- Resend: - Remove failed delivery recipients net/hsr/hsr_framereg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 27dc65d7de67..cc8fcfd3918d 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -156,7 +156,8 @@ static struct hsr_node *hsr_add_node(struct hsr_priv *hsr, new_node->seq_out[i] = seq_out; spin_lock_bh(&hsr->list_lock); - list_for_each_entry_rcu(node, node_db, mac_list) { + list_for_each_entry_rcu(node, node_db, mac_list, + lockdep_is_held(&hsr->list_lock)) { if (ether_addr_equal(node->macaddress_A, addr)) goto out; if (ether_addr_equal(node->macaddress_B, addr)) -- 2.24.1