From nobody Thu Oct 10 17:42:43 2024 X-Original-To: dev-commits-src-main@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 4XPcXg2Hjrz5YMKd; Thu, 10 Oct 2024 17:42:43 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPcXg1Z26z4004; Thu, 10 Oct 2024 17:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728582163; 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=Gj0pBCUSUFy7OTBaxC7kUrM5u+o7y+j0Omg+v3fktO4=; b=rB6lAClWfYaTNPlC4Agufz7mlvzHf9YuTGgFxoeWQH+NWtMl6N9VGe2NXK+mrhZ+PWX+0/ DyTPqJ0Nxoh7CmOmWKmYOx0gViX9e1zyAkQWzIgH35gzra4EDkHPq7AHiVfkNpj2+SBBR8 MXo2eHEzuEn+BCn4W/xG/QbszPL81pzS7gDte1ewyMn72gZXTep37fkpvl/5tX94tmAC5S 08ukHeX/wzhSqG0ZkOUVbLe2xirhFMECRhOdCpDQuw6NOj5il+Lp3zIWcO/J6LFoDzAtjl 7y9R5SaV1uYcLEzl91ZriTOUjYytUA/e2SjEYLqMJVbYoGqRxJRheJ9BBx+QtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728582163; 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=Gj0pBCUSUFy7OTBaxC7kUrM5u+o7y+j0Omg+v3fktO4=; b=e/73HQza6DWtIJqqzIOjXFKcvLOY5R4gyYcpObEeYluA6+P9vVrR7LFjq/z2WKLtDgC3bj klpEOcuTnubYiELSpRch3pzf9V6QxYBYxfQSNQekofRZF5VQcWal0c9KJVI1MX8/IZkT+b mggqd90EWBpHh5TLOPga+6HHJV/eRef7Aw07Hw+dzDBW6beSNLhKEnJlgd07Xan8m0ijCb oH/9HdV04hm+72A8P4fLi1CFyKe4XZ7HD4q5XgU5POpW8jtNa8leMyNzxqcbOa58GIppxU jbQlzlnqKxBmxmM6WyeZCf5NmBqRcnjqoBQxLrp2liE7m9qi8Yxh2y9p0emlYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728582163; a=rsa-sha256; cv=none; b=RF0fkia8ral3GUxsy5xsSwVwiZp9JuLkzz/odC7RR/r/cStvaYZNEsafVHhloYfOrMNGfU atKVpC2lLeClJViZpkoaKhntsulJY7ajMcR3o13DgLASjmImsGUr0UnZZt6LUKHQ93Bb+0 HXjSqN2SSwvpAT4PmzURvU50juM/YZjhBRUT3ad4uvZULbxehG+MTB9m1NFIf2HCmG+89Z JM1ZfGe2cgGYtla6mCuzbFsV/V12+jYVDyG3iFtfLVRRiqdIMZwXrmBFN8BgH5lFvFm47/ hpKZfGTQ7NpHDXoQm1msfBWmJhtByYgKqb+PuxmzR/1aMv/c7QtQYI2HFg99Mg== 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 4XPcXg19tJz16gF; Thu, 10 Oct 2024 17:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AHgh8o032924; Thu, 10 Oct 2024 17:42:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AHghvB032921; Thu, 10 Oct 2024 17:42:43 GMT (envelope-from git) Date: Thu, 10 Oct 2024 17:42:43 GMT Message-Id: <202410101742.49AHghvB032921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 41b746e05231 - main - LinuxKPI: 802.11: fix ieee80211_schedule_txq() to avoid rtw89 panic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 41b746e05231b44c87f3a3087a7fe29966af6d0f Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=41b746e05231b44c87f3a3087a7fe29966af6d0f commit 41b746e05231b44c87f3a3087a7fe29966af6d0f Author: Austin Shafer AuthorDate: 2024-10-10 15:31:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-10 17:42:06 +0000 LinuxKPI: 802.11: fix ieee80211_schedule_txq() to avoid rtw89 panic rtw89 TX path was faulting in linuxkpi_ieee80211_next_txq() due to a "double scheduling" check in linuxkpI_ieee80211_schedule_txq() being incorrect: the next pointer may be NULL there if the element is the last in the tailq, so correctly check tqe_prev. Without the fix we may have queued the same element to the tailq twice, and because it was the last element and had a NULL tqe_next, that NULL value would get propogated into another node's tqe_prev on removal, and other such nastiness. With this rtw89 no longer panics. Reviewed by: bz MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47006 --- sys/compat/linuxkpi/common/src/linux_80211.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index ae765cda5781..4171f0789977 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6074,8 +6074,12 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, if (!withoutpkts && ltxq_empty) goto out; - /* Make sure we do not double-schedule. */ - if (ltxq->txq_entry.tqe_next != NULL) + /* + * Make sure we do not double-schedule. We do this by checking tqe_prev, + * the previous entry in our tailq. tqe_prev is always valid if this entry + * is queued, tqe_next may be NULL if this is the only element in the list. + */ + if (ltxq->txq_entry.tqe_prev != NULL) goto out; lhw = HW_TO_LHW(hw);