From nobody Mon May 23 11:59:10 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 9C79E1B4E4E4; Mon, 23 May 2022 11:59:10 +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 4L6G8G3dPkz3nLT; Mon, 23 May 2022 11:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653307150; 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=XWZ3cyor3CeoKJrBwikCihwEX00sX+/7uOCXt+EIRTk=; b=ZJxIBbtZzhlPw7k1Yzpk++1odgXaglAOcCIBBYrp2+tvoHOEH3pNUxoWXuduoAKUzQR8P7 iy0xAilf/+5kIvl041SK1GrWvTkkiZt8VfRrZ5GtM8Je8Scjy15qMxVZO88oxLcDaPP16O gpjpd6/87ghDAr1m6OGh+PSrgRedLC7lqFmbTop9g0SsZZPuNF4jOY+Zl/pMCa1SKnpOY+ U0sxU3y1gXeq9JPwIPt7/VAGZJFZI2P7teE8wc3fv7F/lTnt/0MaaELRKeYYXXSKDK5E/S U58H4w2VxlHXxGSyMemxwE+hxBsuGKmhyrs21V+AqsTMMOWe4cLT8tsmLV/mzg== 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 589B3768D; Mon, 23 May 2022 11:59:10 +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 24NBxATR060020; Mon, 23 May 2022 11:59:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24NBxAE2060019; Mon, 23 May 2022 11:59:10 GMT (envelope-from git) Date: Mon, 23 May 2022 11:59:10 GMT Message-Id: <202205231159.24NBxAE2060019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: 7e6e22aab6b9 - stable/13 - genet: fix output packet corruption in uncommon case 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e6e22aab6b993e42328bafe0f64ee14a2b7c43c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653307150; 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=XWZ3cyor3CeoKJrBwikCihwEX00sX+/7uOCXt+EIRTk=; b=TuVmjFP8AE4PWNV6QFINOoCQnoApBeXMhZpdo12tXamBzd/xrDPYPu/OG0J5t9HQmKMikB au8WwztqwvGceHfisku9ClGQO3/gQKEPqlnfEtrNWIiTqhNjr6nxtM5qz/mIqeBCSJotfl bC79UG9gMZ4Lyt94ER++EMKxLyQdKuatJD/B59wa/mLTVXV1wKGR9tWlQH1EUh8eIqAqTY wzWBetfU30ykdd37IT/QLwTZMfo/eWcC/hEJcpNKtN+Sk9o5hsG42gX9ofBbbbT9U0XktU Zpx1BhnOkjQNkZBNb4wMlyrUQnkr0Kzkab0J98eZs26q2ptDrXi+YXdnbcpA/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653307150; a=rsa-sha256; cv=none; b=WalkVT0M+LEuPOGyQ767UTXvLyRvsV3JVutpefBFt5IV0kmbi2trI3HP27vUNs3Dv80eZ1 Qv0zt3YkP/UEmsaeWPiJVfytF7vQOpniFxHyHxFvifHI9p5jlkIisuMzoxH+vafBrPXa1D SOXqPo6THehdY1W7qzIvz2yAL97fpOJO1X/LbSqUN/DCwJzxpA8ZRGdS7Qnae0bZ5NpiwL grSdIejFm1iVIllnvpG5LGs+mmXUFTVxs6He3wdICxfkzUW4TvNxnqJo0CZD/V0F0hJ4ye W8f3bFe9ISyELHxxGyrE0eF/IKzVgJI1C8vuZpKCPArrtUNJtI1fZnOkDWW+KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=7e6e22aab6b993e42328bafe0f64ee14a2b7c43c commit 7e6e22aab6b993e42328bafe0f64ee14a2b7c43c Author: Mike Karels AuthorDate: 2022-05-09 12:19:52 +0000 Commit: Mike Karels CommitDate: 2022-05-23 11:53:01 +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 (cherry picked from commit 1de9aa4d4f7938f36e6485dad817908a6e45bb32) --- 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 4532c8d32f90..2437e9ae206c 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; \ } \