From patchwork Mon Jun 1 17:53:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225040 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=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 68D90C433E1 for ; Mon, 1 Jun 2020 18:16:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 366632073B for ; Mon, 1 Jun 2020 18:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035384; bh=EttFuyWUsVA2+0so7dutokKTLb7us68VFKlExgm5ag4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jQwiPlKAOoOKHCM6ygaxaIlmqOLQ41+QKHYJvAkSaMeIYq9SMoCOWw5OI2f8AXr02 Tpxx5q917RGX/1CFwQnNu/LoUwmvK3p+ky9R1fbBlmhpeGjQlBpLnsS9Eu4C3sPtdy QO5cQCwiJPmY/060H3HuBwMGsVZA/6bA3MO15hzA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729805AbgFASQX (ORCPT ); Mon, 1 Jun 2020 14:16:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731692AbgFASQT (ORCPT ); Mon, 1 Jun 2020 14:16:19 -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 BFA8D2068D; Mon, 1 Jun 2020 18:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035379; bh=EttFuyWUsVA2+0so7dutokKTLb7us68VFKlExgm5ag4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hWNLBBgjKoTBkd0VYtt4QV/uhCnvj4AkJkLg3WT/57ZVTJDD6UDfcQEk6+cmX7VZK hVC3o6QX8kJgeUAGDTZEW6kJOXj7ySe85s25oORidmue3LzwUzVfVXBgU0rW5T1rGu n4PyW+DJaO5BRYnhqXlX5hKHtSKrQ+FskcwphpxQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+bb82cafc737c002d11ca@syzkaller.appspotmail.com, Madhuparna Bhowmik , "David S. Miller" , Sasha Levin Subject: [PATCH 5.6 083/177] drivers: net: hamradio: Fix suspicious RCU usage warning in bpqether.c Date: Mon, 1 Jun 2020 19:53:41 +0200 Message-Id: <20200601174055.822494938@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174048.468952319@linuxfoundation.org> References: <20200601174048.468952319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Madhuparna Bhowmik [ Upstream commit 95f59bf88bb75281cc626e283ecefdd5d5641427 ] This patch fixes the following warning: ============================= WARNING: suspicious RCU usage 5.7.0-rc5-next-20200514-syzkaller #0 Not tainted ----------------------------- drivers/net/hamradio/bpqether.c:149 RCU-list traversed in non-reader section!! Since rtnl lock is held, pass this cond in list_for_each_entry_rcu(). Reported-by: syzbot+bb82cafc737c002d11ca@syzkaller.appspotmail.com Signed-off-by: Madhuparna Bhowmik Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/hamradio/bpqether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index fbea6f232819..e2ad3c2e8df5 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c @@ -127,7 +127,8 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev) { struct bpqdev *bpq; - list_for_each_entry_rcu(bpq, &bpq_devices, bpq_list) { + list_for_each_entry_rcu(bpq, &bpq_devices, bpq_list, + lockdep_rtnl_is_held()) { if (bpq->ethdev == dev) return bpq->axdev; }