From nobody Thu Aug 20 14:30:36 2026 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 4hQm7k24TRz6ngkZ for ; Thu, 20 Aug 2026 14:30:42 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hQm7k0sTqz3TQX for ; Thu, 20 Aug 2026 14:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787236242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcBmryoXpRKhz2gJbxo/8URas33pPmvsSWLEG8n1Plk=; b=p+p8+GPLpMwYda1nS+/sxGIsyyD5mhPHLWbnHVk/Pc6YuV8mXN6go34lJgT8SD0OCIg77r JBZwlEP289ZjdbXOlJNf7KBxyWGHP6ngpPquToTQ/l1MdoaW34o/2+esUghQLNn3f6AhH1 FtndXCXW5cHL58OugwEohD47hXjj9ILtDxw3aD2wXMmQHc0FUoop8ZPKQqzbJttEPSQaQz 6O/wqNfA9hHrLPZtEgVMx2ixBwumTUGOs3EZ/TQer02/Hs0hpVGJUb63h6qZB5Jq2ViHTZ 23S3TaSMrfGyGVnHgd1eAZjDBBeCuYcY7WXz+7toAa1a/iQ5Z5IWv8w/hHs+6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787236242; a=rsa-sha256; cv=none; b=j0e5RBlehcSpNAOQStfOR43T/lmIurg1JjFAQKIyHykWX3t2al20TCY8Y54EeB4uGi9C1c 73X6cDGyCTsbcwLhhK+Zcx9xB9Q3XUmS8UUgS/kq+h6dFoZGxu9Q3NFVjtQuNDttWSe1wi wip1AR2p4y6msCsnURO+pAV6cmnNyd4tbSOpzZT2RCHBTuVKqFRS2YfweOrxkU5pC0PJDd ttcKStSGGcRrZd/4N4VStD0PU8ClFQ76qsQJD7CS6iDPFRWSVf8U6fKqP8S6Gdatse68ZB fBFWnTZL3s4u3i+pmoBHqEW2ToDrrmD1qbsTj1dzhXq315uqChXoZu3L5Vnf9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787236242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcBmryoXpRKhz2gJbxo/8URas33pPmvsSWLEG8n1Plk=; b=D5vPAuzTnexxDe8+9WHucKcgOdTMxdYznoAmx4IhYYnGPAzWIp10V9REgugxyLvudD/6Sj 2IvMoAtILzFdvJ1KFBl1CZU10aHsXuVGxrTkXRN6iSTeBkGXGii7m5WEKS1NopreibQALU lGIXHH/ktspi0aww62cOZ3huEB2UqTcp8ae2WR3my3Ud+U/HWVXIbDOZirbSJUjievaZsB vrkAHPehKn8FJn331D+xuF7SH6+4IOj/6n+mHohR8qgQyVlKsi3hbQy1HfKOqResJcUiHN wzkDBV+Uo4J4w1Lv6rlOjWoCoiRp+h8rgbHCMLqrJHH+9nVnKKdBPF9I5i6H9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hQm7j6xK3z4wg for ; Thu, 20 Aug 2026 14:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 327f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 20 Aug 2026 14:30:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Andrew Griffiths From: Mark Johnston Subject: git: 7e9e72bee359 - main - mtw: fix zero-length queue array that can corrupt struct mtw_softc 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e9e72bee359437b9f78c6a4056ef0a90337f341 Auto-Submitted: auto-generated Date: Thu, 20 Aug 2026 14:30:36 +0000 Message-Id: <6a870f8c.327f9.125724fe@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7e9e72bee359437b9f78c6a4056ef0a90337f341 commit 7e9e72bee359437b9f78c6a4056ef0a90337f341 Author: Andrew Griffiths AuthorDate: 2026-08-20 14:29:53 +0000 Commit: Mark Johnston CommitDate: 2026-08-20 14:29:53 +0000 mtw: fix zero-length queue array that can corrupt struct mtw_softc The mtw softc declares sc_epq with MTW_BULK_RX even though MTW_BULK_RX is enum value 0, while initialization and queue handling index up to MTW_EP_QUEUES; attaching a matching USB WLAN device can drive writes past the absent array and corrupt adjacent softc fields. This suggested patch sizes sc_epq with MTW_EP_QUEUES so the softc contains the endpoint queues the driver initializes and uses. Fixes: c14b01624261 ("mt7601U: Importing if_mtw from OpenBSD") Reviewed by: bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D58897 --- sys/dev/usb/wlan/if_mtwvar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/wlan/if_mtwvar.h b/sys/dev/usb/wlan/if_mtwvar.h index 3cf4c4f9c94e..67b9291cefc2 100644 --- a/sys/dev/usb/wlan/if_mtwvar.h +++ b/sys/dev/usb/wlan/if_mtwvar.h @@ -320,7 +320,7 @@ struct mtw_softc { struct mtw_txd_fw *txd_fw[4]; int sc_sent; uint8_t sc_ivb_1[MTW_MCU_IVB_LEN]; - struct mtw_endpoint_queue sc_epq[MTW_BULK_RX]; + struct mtw_endpoint_queue sc_epq[MTW_EP_QUEUES]; uint8_t rfswitch; uint8_t ext_2ghz_lna; uint8_t ext_5ghz_lna;