From nobody Sun Nov 01 18:35:42 2026 X-Original-To: dev-commits-src-all@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 4jHk6k37RSz6xjXh for ; Sun, 01 Nov 2026 18:35: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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jHk6k1frFz3KYS for ; Sun, 01 Nov 2026 18:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793558142; 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=vOQrgI2d/ZK5TM+y8J2uY13MkgB2oE30aQUg8VbqDWw=; b=xSBHyFOTvCQ46rKPOfLjfEHhlaERMC7bPfmqz+7/nMzMWAG6PzWDLrRmw5S2yELmWuTjn3 4e1qEdFD88ZRh9gbPg1vZaNjiO7N0QIcz5t/frBdINaaeVzoJOZvZxNVR+mcpT7/Sr1gNl p6gnvYA1FHqb7fk9m/N1NG1RXAzsCX9qjCLWSImIahmv6lZk6QUoHZNQlSjbK3y/lNDoLv ZLYSYFViOfCL6fqC1t4a7FtyIHLxqGhNVX2x6KJaG5qG4eWh5MAYpJV6VB1RE6Vj1RdIAa FDkZpo+bC80AcDYAjZS6p2471Fc6urjgHK+oMCk5C4bln5OWGEJfrNXPUfOYFQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793558142; b=LW2Bo0U7Y18lxZXn/RnWQ1C9xjkhsU7I9XStL9uDpyRZauw9mmRqm6Y0+9XJZHT7LkLyPG kP8pNu8Br1NaX2i+OS1c/wYmcheVpn/4Czv8DyIhTK/ZrPrLmJF3GuWWHLaODCL4yxEpup nSziBUa4Hs8qsElzKAUfvQkB/EkrcTfqrmIqi7fSqFwxgLGiYeN8or40XQVw21tmD3OiSA YJddvysNHopaLmyPWlGsbqyL7/rOe5TQfHIm/3PGK/4Zr5qE9XTqWmki2iHkCDLt4MRVF9 DwvLXf+f4+kBHjcCbcYJVen33Q6tjL7/oMKcq466oX2a6xWhAbi7BnZPjtRGVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793558142; 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=vOQrgI2d/ZK5TM+y8J2uY13MkgB2oE30aQUg8VbqDWw=; b=UKrLEAQW/FL06MJ6tQvwXVGampQ80wSCkjfOVV46gnDqUIbmJOYo75qWKyQ5OfE/vA1xtk yVg38oCfUZVQAIzuPf5uFhPmDXLNB8r0WZ5VM/rLQjFUsPPS0JQDPN4eQfX/wf8D2zqYpB S+Gnv1KsanV0W64hGb8lGcS8r3OUi3bxZPxA+YxujfSrQq2Jb25i6od58dpfgqKW7Q2aO4 0ByrFbHjrzlFiOBzV4HhkkEmqcXbSc+8jpbbhQTTplRpvqF3b/STGDlxiYG6usUITWE16x +k34XfE0qQowKx2iYm3ObJg0aKUZC8bq80dpobJldLq51VzDzjWRUJiIqcd49g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jHk6k0v6lz18hh for ; Sun, 01 Nov 2026 18:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24a98 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 01 Nov 2026 18:35:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Abdelkader Boudih Subject: git: 618bedfe920b - stable/15 - fwip: Fix M_PKTHDR loss in fwip_async_output broadcast path List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository 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: seuros X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 618bedfe920be4dfb3b7c37f86f726880ba18176 Auto-Submitted: auto-generated Date: Sun, 01 Nov 2026 18:35:42 +0000 Message-Id: <6ae7867e.24a98.3988ca0e@gitrepo.freebsd.org> The branch stable/15 has been updated by seuros: URL: https://cgit.FreeBSD.org/src/commit/?id=618bedfe920be4dfb3b7c37f86f726880ba18176 commit 618bedfe920be4dfb3b7c37f86f726880ba18176 Author: Abdelkader Boudih AuthorDate: 2026-07-05 18:26:05 +0000 Commit: Abdelkader Boudih CommitDate: 2026-11-01 17:01:42 +0000 fwip: Fix M_PKTHDR loss in fwip_async_output broadcast path M_PREPEND in the broadcast branch may call m_prepend(9) which allocates a new head mbuf and calls m_move_pkthdr(), stripping M_PKTHDR from the old mbuf. xfer->mbuf was set before M_PREPEND, so it pointed at the deheadered old mbuf. bus_dmamap_load_mbuf(9) asserts M_PKTHDR and panics. Reviewed by: zlei, adrian Differential Revision: https://reviews.freebsd.org/D57495 (cherry picked from commit 22ddc9eb1d7a4fffe78b0692bdc4ec03e1d04ac4) --- sys/dev/firewire/if_fwip.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 42f0c6f53743..0e747d795e25 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -579,13 +579,6 @@ fwip_async_output(struct fwip_softc *fwip, if_t ifp) * it adds the link-level encapsulation. */ - /* - * Put the mbuf in the xfer early in case we hit an - * error case below - fwip_output_callback will free - * the mbuf. - */ - xfer->mbuf = m; - /* * We use the arp result (if any) to add a suitable firewire * packet header before handing off to the bus. @@ -601,7 +594,18 @@ fwip_async_output(struct fwip_softc *fwip, if_t ifp) */ uint32_t *p; + /* + * M_PREPEND may move M_PKTHDR to a new head mbuf. + * Keep xfer->mbuf NULL until it succeeds. + */ + xfer->mbuf = NULL; M_PREPEND(m, 2*sizeof(uint32_t), M_NOWAIT); + if (m == NULL) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + fwip_output_callback(xfer); + continue; + } + xfer->mbuf = m; p = mtod(m, uint32_t *); fp->mode.stream.len = m->m_pkthdr.len; fp->mode.stream.chtag = broadcast_channel; @@ -624,6 +628,10 @@ fwip_async_output(struct fwip_softc *fwip, if_t ifp) struct fw_device *fd; struct fw_eui64 eui; + /* + * Error paths below let the callback free m. + */ + xfer->mbuf = m; eui.hi = ntohl(destfw->sender_unique_ID_hi); eui.lo = ntohl(destfw->sender_unique_ID_lo); if (fwip->last_dest.hi != eui.hi ||