From nobody Sun Jan 16 23:21:01 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 27EC41967B40; Sun, 16 Jan 2022 23:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JcWHf6DJ6z3mVt; Sun, 16 Jan 2022 23:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642375263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzI3Xy9n8Ff8NJgsyNxDHkE1L2zxf/Ry0J0p/Y1Bs+8=; b=qiM9RXFOL323rEuuBSoaHacpsv2FjlXWoszWGCoC7exogsmmcml/FIpL5bzkE48oAMQUMQ 5zMgIUDxtUtDyYJZK5FpLfRqsDSqkO6jBqOcHrT+WfaeA3hCXaQHHQtqZXalE2GpDVDAGd AofwVaTQ//pDo/ERP4zCcAeeSjg8eBxWVmhMDiSaqwa9jTOmdU3LAUJmI8aWL0Qk/Oltsz GYNb+GTbBY57i0TMoZgOi7/vIU55A7ASNFnXHlJtteEEyebCodoNdfmP4Z2h0xTYIs4rpd 2xHdtrgXITbU/XXnzXnu1vayaXGleCw4X4fyyJ+MXDC+W5ndpnrZlG8l76atvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4D6322FE8; Sun, 16 Jan 2022 23:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20GNL1FW053717; Sun, 16 Jan 2022 23:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20GNL1VE053716; Sun, 16 Jan 2022 23:21:01 GMT (envelope-from git) Date: Sun, 16 Jan 2022 23:21:01 GMT Message-Id: <202201162321.20GNL1VE053716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 82a6a8c2941a - stable/13 - LinuxKPI: 802.11 fix locking in lkpi_stop_hw_scan() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 82a6a8c2941ac7819b90c841484ed6a155e2a459 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642375263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzI3Xy9n8Ff8NJgsyNxDHkE1L2zxf/Ry0J0p/Y1Bs+8=; b=doreEdAvXOicDiG4hCrJMwDbcx9SQiQDL9xY+ZmIJnvG/g/w5xWXR/mNgMmGkvzyXXOUFI E37VPeV9mFphZkupiXy+WCQfL7K6UDhe1zLtnCBkJSz7e65FnJQ3TtIbqneVgvx9pd3PNM MX3oEwbU7EH9JXUD6asMA3j0o1X3rkg2hThEVZKJmfn0XLcd+lZsxjZjil4VFvhluhjdhM BZ/x+vnmGT1HlXVOiBP68W+MPhqCgcgNRxkbZyyk2VIqB/wsWUuezigppXC/yIdYrnQ6il cuZTeLSCVjrYxhncNYIWJKJAHcNfM7AUz0y27tRw6y5sNBE0ghGH0dQ5C3FmXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642375263; a=rsa-sha256; cv=none; b=CevAWp/akqX0joHh9bsteWpxPx58DQnU2DuxloUI1pONvwjP6zCZowMWQ3n2Dl7TuXYXNS 4aL+23kmlspsvQNG3C8BtsIg/d0J7p44jcgeusbEkG0GdkmGMIfqITzT53gZUuPelJn7J1 NuH3TSUjLFNeWXNiR4b5kK0CQh4vhSopr0iBP2x+IcJlrXs4l96oJkciyUJaGxS9vYTv9k KfrOkKUVsgNndyKorzL0Q06ASTzfuNXeE8YhH8gN03wmAsVORpqIU9nb/poGUqfzKJJAV9 wDXj5Fe4CKPLbynQ9uNyaIhmGWjlh7uRTQETn2OPqkiZT6fMakNdE4vdunwMcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=82a6a8c2941ac7819b90c841484ed6a155e2a459 commit 82a6a8c2941ac7819b90c841484ed6a155e2a459 Author: Bjoern A. Zeeb AuthorDate: 2022-01-10 22:12:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-01-16 22:39:28 +0000 LinuxKPI: 802.11 fix locking in lkpi_stop_hw_scan() In lkpi_stop_hw_scan() we have to unlock around cancelling the hardware scan and an msleep to wait for the confirmation that the scan ended. Otherwise we are sleeping with the non-sleepable net80211 com lock held. At the same time we need to hold the lhw lock for the msleep(). This lock change got lost in the refactoring of lkpi_iv_newstate(). Reported by: ambrisko, delphij PR: 261075 Sponsored by: The FreeBSD Foundation (cherry picked from commit bec766282f242aab3a4bfba402ea74cb0ccf96fb) --- sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 8515152d66a6..ff58d715ac65 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -573,11 +573,15 @@ lkpi_stop_hw_scan(struct lkpi_hw *lhw, struct ieee80211_vif *vif) hw = LHW_TO_HW(lhw); + IEEE80211_UNLOCK(lhw->ic); + LKPI_80211_LHW_LOCK(lhw); /* Need to cancel the scan. */ lkpi_80211_mo_cancel_hw_scan(hw, vif); /* Need to make sure we see ieee80211_scan_completed. */ error = msleep(lhw, &lhw->mtx, 0, "lhwscanstop", hz/2); + LKPI_80211_LHW_UNLOCK(lhw); + IEEE80211_LOCK(lhw->ic); if ((lhw->scan_flags & LKPI_SCAN_RUNNING) != 0) ic_printf(lhw->ic, "%s: failed to cancel scan: %d (%p, %p)\n",