Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:57146 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753073AbcHXNOZ (ORCPT ); Wed, 24 Aug 2016 09:14:25 -0400 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Subject: Re: [BUGFIX, 1/2] brcmfmac: Check rtnl_lock is locked when removing interface From: Kalle Valo In-Reply-To: <147125405701.9434.12911635695339175773.stgit@devbox> To: mhiramat@kernel.org Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <20160824131425.0681061C42@smtp.codeaurora.org> (sfid-20160824_151443_509538_1F5C74F3) Date: Wed, 24 Aug 2016 13:14:24 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org List-ID: mhiramat@kernel.org wrote: > Check rtnl_lock is locked in brcmf_p2p_ifp_removed() by passing > rtnl_locked flag. Actually the caller brcmf_del_if() checks whether > the rtnl_lock is locked, but doesn't pass it to brcmf_p2p_ifp_removed(). > > Without this fix, wpa_supplicant goes softlockup with rtnl_lock > holding (this means all other process using netlink are locked up too) > > e.g. > [ 4495.876627] INFO: task wpa_supplicant:7307 blocked for more than 10 seconds. > [ 4495.876632] Tainted: G W 4.8.0-rc1+ #8 > [ 4495.876635] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 4495.876638] wpa_supplicant D ffff974c647b39a0 0 7307 1 0x00000000 > [ 4495.876644] ffff974c647b39a0 0000000000000000 ffff974c00000000 ffff974c7dc59c58 > [ 4495.876651] ffff974c6b7417c0 ffff974c645017c0 ffff974c647b4000 ffffffff86f16c08 > [ 4495.876657] ffff974c645017c0 0000000000000246 00000000ffffffff ffff974c647b39b8 > [ 4495.876664] Call Trace: > [ 4495.876671] [] schedule+0x3c/0x90 > [ 4495.876676] [] schedule_preempt_disabled+0x15/0x20 > [ 4495.876682] [] mutex_lock_nested+0x176/0x3b0 > [ 4495.876686] [] ? rtnl_lock+0x17/0x20 > [ 4495.876690] [] rtnl_lock+0x17/0x20 > [ 4495.876720] [] brcmf_p2p_ifp_removed+0x4d/0x70 [brcmfmac] > [ 4495.876741] [] brcmf_remove_interface+0x196/0x1b0 [brcmfmac] > [ 4495.876760] [] brcmf_p2p_del_vif+0x111/0x220 [brcmfmac] > [ 4495.876777] [] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac] > [ 4495.876820] [] nl80211_del_interface+0xfe/0x3a0 [cfg80211] > [ 4495.876825] [] genl_family_rcv_msg+0x1b5/0x370 > [ 4495.876832] [] ? trace_hardirqs_on+0xd/0x10 > [ 4495.876836] [] genl_rcv_msg+0x7d/0xb0 > [ 4495.876839] [] ? genl_family_rcv_msg+0x370/0x370 > [ 4495.876846] [] netlink_rcv_skb+0x97/0xb0 > [ 4495.876849] [] genl_rcv+0x28/0x40 > [ 4495.876854] [] netlink_unicast+0x1d3/0x2f0 > [ 4495.876860] [] ? netlink_unicast+0x14b/0x2f0 > [ 4495.876866] [] netlink_sendmsg+0x2eb/0x3a0 > [ 4495.876870] [] sock_sendmsg+0x38/0x50 > [ 4495.876874] [] ___sys_sendmsg+0x27f/0x290 > [ 4495.876882] [] ? mntput_no_expire+0x5/0x3f0 > [ 4495.876888] [] ? mntput_no_expire+0x8e/0x3f0 > [ 4495.876894] [] ? mntput_no_expire+0x5/0x3f0 > [ 4495.876899] [] ? mntput+0x24/0x40 > [ 4495.876904] [] ? __fput+0x190/0x200 > [ 4495.876909] [] __sys_sendmsg+0x45/0x80 > [ 4495.876914] [] SyS_sendmsg+0x12/0x20 > [ 4495.876918] [] entry_SYSCALL_64_fastpath+0x23/0xc1 > [ 4495.876924] [] ? trace_hardirqs_off_caller+0x1f/0xc0 > > Signed-off-by: Masami Hiramatsu > Acked-by: Rafał Miłecki Thanks, 2 patches applied to wireless-drivers.git: 15dacf880e49 brcmfmac: Check rtnl_lock is locked when removing interface b64abcb7dae6 brcmfmac: Change vif_event_lock to spinlock -- Sent by pwcli https://patchwork.kernel.org/patch/9280681/