Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4233029ybb; Tue, 7 Apr 2020 03:30:06 -0700 (PDT) X-Google-Smtp-Source: APiQypIZ49zZTk3+ucX2GXhvGkYlFfliRNqwQ6g864bGP8Cd8lkUfhd2pTDHCxecVBkZ8Zb6Jaa1 X-Received: by 2002:a9d:2c01:: with SMTP id f1mr966043otb.67.1586255405808; Tue, 07 Apr 2020 03:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586255405; cv=none; d=google.com; s=arc-20160816; b=PUBEXWxsIQ9//uNU/kRgYC3h/DATHj1EWm7tkplav1Ew79GWBinq061PRe6gsOp2QN OCAtRGelUuvCuM7RkJMg35UhHLtDIDgiRv8BMGkYC8+/mtWr0KLkxG1/UPD9NOts+zme 6US5mJnHFm5hwhd7hpPY0Zas0qnvlzRw5k36qOTCn6+C2LsCisdPEmHZkXAcHApe2+ST sYpl3Z9xjOcYU+mhLFZwzmmqrI4VszTyhSKvQC3AlE1oqFVGPSS1i/1HsxPUbdC5QTFI a5bM/hmMXgMefGPall50PUmmOiDtLUHk5w7uB6JN64xahSNJjgsL9LKGmg4IlY9U9iTT Ld2g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gOvY4HydhDCx7oBnW/T7T1TzuM39GFcKTHqqq4IhldQ=; b=XbgEXWSFhoh56lQxL5ypBCIWBitlL4zc2tgZ8O3Dv6dCG3EGs24dJ8bwcHoRnmBYu/ xxAFShKr59P9/l3kP/HsdahvzWm5D8zaE/odgx5gaRn2h9biptQ0nEewdAdeot2WFINN w6/AtpP5tH5hWBFCYWcfegkQgK2DdeUb0dAMyw1mfVovUKMeJUnadscLpZeuW5erDe8Z P5ve6DUfkM3SOo5g7uIOTvoPAHZFOO+m8rtDqakfn3WM415IUq+GIBb//Jvz0fyAjyis o29iYF5mN/xbjnDvcuQmZKdZK0u52UPXovdqYyI3qHXl+QzXLckQ1YEnKgbGr0KyJJVE AbuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2ZpoRXpN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66si1020023otx.151.2020.04.07.03.29.54; Tue, 07 Apr 2020 03:30:05 -0700 (PDT) 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=@kernel.org header.s=default header.b=2ZpoRXpN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728732AbgDGKYd (ORCPT + 99 others); Tue, 7 Apr 2020 06:24:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:34782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728720AbgDGKYa (ORCPT ); Tue, 7 Apr 2020 06:24:30 -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 C2EA620801; Tue, 7 Apr 2020 10:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586255070; bh=DCZ2l5F56FR9NskugDQGc4jykl12y8rfDISYAsN/Awo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ZpoRXpN8jx1+gbVYZSgeBKfnuo9UHdJYvEt20DAdoyTZFj1V7773cGSgFOwPtHF/ bs70Nm3yjF4k4iZ92NoK6Ct/UAvW4lBDJJNKs5YpNyC9iP/bOZ5VrxuJm9UylgcAc9 lF7jdq+hoJdYO0rPNhDfIRGOrYYkXQ0s0DxDdH78= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Matthias Kaehlcke , Brian Norris , Douglas Anderson , Guenter Roeck , franky.lin@broadcom.com, Kalle Valo , Sasha Levin Subject: [PATCH 5.5 18/46] brcmfmac: abort and release host after error Date: Tue, 7 Apr 2020 12:21:49 +0200 Message-Id: <20200407101501.481443066@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200407101459.502593074@linuxfoundation.org> References: <20200407101459.502593074@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck [ Upstream commit 863844ee3bd38219c88e82966d1df36a77716f3e ] With commit 216b44000ada ("brcmfmac: Fix use after free in brcmf_sdio_readframes()") applied, we see locking timeouts in brcmf_sdio_watchdog_thread(). brcmfmac: brcmf_escan_timeout: timer expired INFO: task brcmf_wdog/mmc1:621 blocked for more than 120 seconds. Not tainted 4.19.94-07984-g24ff99a0f713 #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. brcmf_wdog/mmc1 D 0 621 2 0x00000000 last_sleep: 2440793077. last_runnable: 2440766827 [] (__schedule) from [] (schedule+0x98/0xc4) [] (schedule) from [] (__mmc_claim_host+0x154/0x274) [] (__mmc_claim_host) from [] (brcmf_sdio_watchdog_thread+0x1b0/0x1f8 [brcmfmac]) [] (brcmf_sdio_watchdog_thread [brcmfmac]) from [] (kthread+0x178/0x180) In addition to restarting or exiting the loop, it is also necessary to abort the command and to release the host. Fixes: 216b44000ada ("brcmfmac: Fix use after free in brcmf_sdio_readframes()") Cc: Dan Carpenter Cc: Matthias Kaehlcke Cc: Brian Norris Cc: Douglas Anderson Signed-off-by: Guenter Roeck Reviewed-by: Douglas Anderson Acked-by: franky.lin@broadcom.com Acked-by: Dan Carpenter Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index a935993a3c514..d43247a95ce53 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -1934,6 +1934,8 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) if (brcmf_sdio_hdparse(bus, bus->rxhdr, &rd_new, BRCMF_SDIO_FT_NORMAL)) { rd->len = 0; + brcmf_sdio_rxfail(bus, true, true); + sdio_release_host(bus->sdiodev->func1); brcmu_pkt_buf_free_skb(pkt); continue; } -- 2.20.1