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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 4C428C38A2A for ; Fri, 8 May 2020 12:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 255DF21473 for ; Fri, 8 May 2020 12:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942739; bh=YNOc2verFZCxdF+PEr0mt3qsZBXxUQ4tOaOWm46Gf7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vZnxTwRYg8OmO80ejPavFUXvx2NeY2FsbuzqOLPpKdtkpiQU85DJFwtsbcxN5mm7y wl0QwvD2mDVwBE3FPa0mHKn9CVGL2tkIZ0qzhY6e6I1d0r1jPKo3lCcDz2oeDG5MGH PqoFf30bloMSe7V0UWXOB56ZscU0J+atocnYypGM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbgEHM6y (ORCPT ); Fri, 8 May 2020 08:58:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:35992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730100AbgEHMx4 (ORCPT ); Fri, 8 May 2020 08:53:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C18EC2495C; Fri, 8 May 2020 12:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942436; bh=YNOc2verFZCxdF+PEr0mt3qsZBXxUQ4tOaOWm46Gf7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kXS8w68KkXCGNV2QAxioXkFRcHMnK14ZextSKa/2lfEJDomI/A9gmnouTLClRbXvw 6JqPwZMnMBeSzjUiRB/S5qQsC9yO3ctuuHuwdNlRCm3q34b5dwNUinK0sPp11A38Sf 94m7i2WSFdJbeiByoBq2Ji55NEGRtyKxBy6h6rjs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Madhuparna Bhowmik , Johannes Berg , Sasha Levin Subject: [PATCH 5.4 27/50] mac80211: sta_info: Add lockdep condition for RCU list usage Date: Fri, 8 May 2020 14:35:33 +0200 Message-Id: <20200508123047.119009426@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123043.085296641@linuxfoundation.org> References: <20200508123043.085296641@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Madhuparna Bhowmik [ Upstream commit 8ca47eb9f9e4e10e7e7fa695731a88941732c38d ] The function sta_info_get_by_idx() uses RCU list primitive. It is called with local->sta_mtx held from mac80211/cfg.c. Add lockdep expression to avoid any false positive RCU list warnings. Signed-off-by: Madhuparna Bhowmik Link: https://lore.kernel.org/r/20200409082906.27427-1-madhuparnabhowmik10@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/sta_info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 21b1422b1b1c3..b1669f0244706 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -217,7 +217,8 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata, struct sta_info *sta; int i = 0; - list_for_each_entry_rcu(sta, &local->sta_list, list) { + list_for_each_entry_rcu(sta, &local->sta_list, list, + lockdep_is_held(&local->sta_mtx)) { if (sdata != sta->sdata) continue; if (i < idx) { -- 2.20.1