From nobody Mon May 09 13:46:20 2022 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 932211ABFF9D; Mon, 9 May 2022 13:46:20 +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 4KxjBN3kkdz3rhW; Mon, 9 May 2022 13:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652103980; 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=UGrEMbtEj6WJAGzDgj82VigGhPuRKAauHUGBPrkGwM4=; b=SX0PyplvvstVD9c/gl7k5HiZW33xC7c7XBAy0eCqThmCOFR+l7YmFRwEzOx/FvBpX24Wl3 IkGECdFkAQEc54wrktrs0hmJHpaaZ20wpPyylaUAECxjwpltxxTPvspVM/iQiPIB1XZwNh TevdbKn3etIB5sifdPUyKSd9OsqIglD7mKGozg3lHa6STVgheJ9ePV0zZslrjZzODyLd7m 0wFuFDAIhuqjGibyo8HzSq5XYp/pdwhbVYLFjm7MehRiRTSSlc47mQgKNrD8cUe1BXk+Q9 DsWmzxvZA4EAhvNbTM65N0HqMQXGIO2HHzgvCa1jm85/b/582wr7iVoa0JMrMA== 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 5CC3411CCD; Mon, 9 May 2022 13:46:20 +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 249DkKGf026166; Mon, 9 May 2022 13:46:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 249DkK5b026165; Mon, 9 May 2022 13:46:20 GMT (envelope-from git) Date: Mon, 9 May 2022 13:46:20 GMT Message-Id: <202205091346.249DkK5b026165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 1de9aa4d4f79 - main - genet: fix output packet corruption in uncommon case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1de9aa4d4f7938f36e6485dad817908a6e45bb32 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652103980; 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=UGrEMbtEj6WJAGzDgj82VigGhPuRKAauHUGBPrkGwM4=; b=q8jIxYxVjBM4T5KlU3vM9v5tH3fiaupsyYuEPVEQaMPzup7JYxrE4li8LgL4bhEOhx+2Hr q1p9EKCQ37SuL4JIEgOxPh1cqGBRCkFuwsTQWIMoNnzIBM82KSEvhbajoS4AO1CK/MgHBi xchMzQcrOre+gTAcJMb7yw6LggxWjvWWbdhaE/ygYXrpanC1NxOZwHxuKAqPk6exFvuKJv YMqxpA7/HrF99zj81TPVoTwKS/sUuvs2XHwft5+Qq9oK86r49/qXG6zl8uXOyzkOsqmEaJ 3rbH7pxQE0nWqi0q3Ut8uBcrJWXyUJ+A0SpCaB+Mk+r1BFzWr0rbNo7zdI5Gpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652103980; a=rsa-sha256; cv=none; b=vcsGFrF+Hml3OD/qRkCrQNQJOUw95zU5FFQuStuGdsWk67ImBXL+NFAFUPoIDDtWqY0wHw a7MByCo2+tIS196g6cr9vES4wPfahjbsNzughRWBuq5xDUWu8LwSx3/06dxt+VmXrVXRKk x5EjG8Q/hggSHn01HifKj59Xn4ULJV/t/MMxZPNP2C9byZDf1RsY+7wIR/wa5xjAJ+X4Vm dB1ju9kdQDABz60smmkWKOQvjlgY5Axxi26cWKkxEGBAa6GWRoaFEjc0Cwlm/AcPvv+yFt MdL2liLlk4oBsMCoFRjsLqZfIlrHEKJkTI1l1wbjbx+G3kYw1IwbNNerHNytNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=1de9aa4d4f7938f36e6485dad817908a6e45bb32 commit 1de9aa4d4f7938f36e6485dad817908a6e45bb32 Author: Mike Karels AuthorDate: 2022-05-09 12:19:52 +0000 Commit: Mike Karels CommitDate: 2022-05-09 13:46:06 +0000 genet: fix output packet corruption in uncommon case The code for the "shift" block in the COPY macro set the pointer for the next copy block to the wrong value. In this case, the link-layer header would be overwritten by the network-layer header. This case is difficult or impossible to exercise in the current driver without changing the value of the hw.genet.tx_hdr_min sysctl. Correct the pointer. While here, remove a line in the macro that was marked "unneeded", which was actually wrong. PR: 263824 Submitted by: jiahali@blackberry.com MFC after: 2 weeks --- sys/arm64/broadcom/genet/if_genet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index 47ff3a484387..3e22f387bf61 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -1254,11 +1254,10 @@ gen_parse_tx(struct mbuf *m, int csum_flags) m0->m_data = m0->m_pktdat; \ bcopy(p0, mtodo(m0, sizeof(struct statusblock)),\ m0->m_len - sizeof(struct statusblock)); \ - copy_p = mtodo(m0, sizeof(struct statusblock)); \ + copy_p = mtodo(m0, m0->m_len); \ } \ bcopy(p, copy_p, hsize); \ m0->m_len += hsize; \ - m0->m_pkthdr.len += hsize; /* unneeded */ \ m->m_len -= hsize; \ m->m_data += hsize; \ } \