From nobody Fri May 10 02:01:00 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 4VbBth405bz5KXls; Fri, 10 May 2024 02:01:00 +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 4VbBth2sP8z4Q88; Fri, 10 May 2024 02:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715306460; 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=/ezdPNCIBwgXDb+Fi2pNsp6Bo2r10rj7XdRZhmrmXzk=; b=IGQr67eru+KnGEy1+Ippr10Rg6chSwSzq89rsksB8j8wZGY3FcfW75Clb6LoYNOYHn+ejG ++wRrnNA9slweX6DtUBU+SO4dV7q50L9KQ9a6nUWvXuiJ0LRRP+3fQQkBmHsSk+mthaBsW dlGGa9U58ueacbHcEGfa//Hhl7JaZoQn+e3HA44Sig6IwEf7RFNTR1ls2WJE6GJ/XJ0zsQ uje9wkC1n4r6c+Dz+2FdMZU9Te6zbIUOinhM0jKugsKUAvIjCcjGwmFJbokHEJ5lLNv40v OJD2s58aiiZXsLD9/qGULFkkDIesZjtZHpLKnepXV9n+lgMfdTBFQxzG3pwp3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715306460; a=rsa-sha256; cv=none; b=Tmxs4zkRDpNacKl4NDZbImo9za72bPo/bSQGvfxD9D0CnN0q0YLXHd372tF0Q3jgGRqxrh 4BPIMW21mZwboxtipGQVRp7yahHAg9bAFS1wfBT+XOn9RzIjt/Y5IbYuDGe1REtSTZH7ol JMIahdzQJz13GdP5Gnk3HgvN5AyX03yBt5DfnEzvgGKaBwZzMuQEv0Wg/YPOFBRY1wxHTc IHHDYZHRRjoRivq2JQ+UscZDI4JJLpHsQRca6dGDdGdMWcVu9gra/RCDvDqChS8MQUnz6f Ir0XZ4O44e+tFlLN3SbxPE5Q//QnRDQDmY9Y4ag+9Y4sIjg1ssAJcWkoqU9neg== 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=1715306460; 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=/ezdPNCIBwgXDb+Fi2pNsp6Bo2r10rj7XdRZhmrmXzk=; b=k10Jv84xpxEerjgy5yvPMLF3UyEI5/cIMqXh8r4e9d1ltjBtyth296VOKKSlbcUpzpBcA2 jBXocYvpPlL8oXGbAK0EYoVVUknGZC+yPfD/vm/PSXAkydQOR4CPSzXhi2E7+Rq3yJtVNd lISyXIa51lBDL8BD78cn0EcLLtlY8iAlXPuKofBzwDaINbrmH7W/x6m66Jymtz9rXfJKgK oWGrhxSGLLdZhqkkUuFukYTVsveGQC0ihNYXmXehrB6IC0tC/Sjp3qlRt7QN2X0RTl4Zgt Ip0hDUKisU+PoKd8XYFTvhEjtmJqGFji3iFWC9iGla+BqsFGzR1ovPU5+eFiBw== 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 4VbBth2RmdzJ2q; Fri, 10 May 2024 02:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A2104J031526; Fri, 10 May 2024 02:01:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A210NT031523; Fri, 10 May 2024 02:01:00 GMT (envelope-from git) Date: Fri, 10 May 2024 02:01:00 GMT Message-Id: <202405100201.44A210NT031523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 12be6f12e87a - main - Fix memory corruption in C++ demangler 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12be6f12e87abc3e1edd3cc6cdc20334bdd63380 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=12be6f12e87abc3e1edd3cc6cdc20334bdd63380 commit 12be6f12e87abc3e1edd3cc6cdc20334bdd63380 Author: Justine Tunney AuthorDate: 2024-05-10 01:55:45 +0000 Commit: Warner Losh CommitDate: 2024-05-10 01:55:52 +0000 Fix memory corruption in C++ demangler The __cxa_demangle_gnu3() and cpp_demangle_gnu3() functions segfault on various libcxxabi test cases due to a copy and paste error. This change fixes that. This is a subset of https://github.com/libcxxrt/libcxxrt/pull/34 which fixes the immediate problem. Reviewed by: imp, emaste (I think) Pull Request: https://github.com/freebsd/freebsd-src/pull/1222 --- contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c | 2 +- contrib/libcxxrt/libelftc_dem_gnu3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c b/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c index a84ca2649497..223878aa34ea 100644 --- a/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c +++ b/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c @@ -2138,7 +2138,7 @@ cpp_demangle_read_sname(struct cpp_demangle_data *ddata) assert(ddata->cur_output->size > 0); if (vector_read_cmd_find(&ddata->cmd, READ_TMPL) == NULL) ddata->last_sname = - ddata->cur_output->container[ddata->output.size - 1]; + ddata->cur_output->container[ddata->cur_output->size - 1]; ddata->cur += len; diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c index e75d1694562e..dbdbd6f2414e 100644 --- a/contrib/libcxxrt/libelftc_dem_gnu3.c +++ b/contrib/libcxxrt/libelftc_dem_gnu3.c @@ -2472,7 +2472,7 @@ cpp_demangle_read_sname(struct cpp_demangle_data *ddata) assert(ddata->cur_output->size > 0); if (vector_read_cmd_find(&ddata->cmd, READ_TMPL) == NULL) ddata->last_sname = - ddata->cur_output->container[ddata->output.size - 1]; + ddata->cur_output->container[ddata->cur_output->size - 1]; ddata->cur += len;