From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 256D7138350 for ; Sun, 5 Apr 2020 07:18:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 85C6EE09F0; Sun, 5 Apr 2020 07:18:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 589A7E09ED for ; Sun, 5 Apr 2020 07:18:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9691D34F003 for ; Sun, 5 Apr 2020 07:18:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B22B61C6 for ; Sun, 5 Apr 2020 07:18:26 +0000 (UTC) From: "Joonas Niilola" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Joonas Niilola" Message-ID: <1586071075.1b96cea8f4a077237e5dbe479ac375bad9d777e4.juippis@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/bglibs/, dev-libs/bglibs/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/bglibs/bglibs-2.04-r2.ebuild dev-libs/bglibs/files/bglibs-2.04-stack-buffers.patch X-VCS-Directories: dev-libs/bglibs/files/ dev-libs/bglibs/ X-VCS-Committer: juippis X-VCS-Committer-Name: Joonas Niilola X-VCS-Revision: 1b96cea8f4a077237e5dbe479ac375bad9d777e4 X-VCS-Branch: master Date: Sun, 5 Apr 2020 07:18:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 71b892a2-87f4-4598-803e-bd2ac8da6a8e X-Archives-Hash: 794edcffad9fc9ee7d7587bc131db04a commit: 1b96cea8f4a077237e5dbe479ac375bad9d777e4 Author: Rolf Eike Beer sf-mail de> AuthorDate: Sat Apr 4 16:25:38 2020 +0000 Commit: Joonas Niilola gentoo org> CommitDate: Sun Apr 5 07:17:55 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b96cea8 dev-libs/bglibs: properly align buffers on stack Closes: https://bugs.gentoo.org/700190 Signed-off-by: Rolf Eike Beer sf-mail.de> Closes: https://github.com/gentoo/gentoo/pull/15226 Signed-off-by: Joonas Niilola gentoo.org> dev-libs/bglibs/bglibs-2.04-r2.ebuild | 75 ++++++++++++++++++++++ .../bglibs/files/bglibs-2.04-stack-buffers.patch | 47 ++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/dev-libs/bglibs/bglibs-2.04-r2.ebuild b/dev-libs/bglibs/bglibs-2.04-r2.ebuild new file mode 100644 index 00000000000..01bff0a74aa --- /dev/null +++ b/dev-libs/bglibs/bglibs-2.04-r2.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="Bruce Guenter's Libraries Collection" +HOMEPAGE="https://untroubled.org/bglibs/" +SRC_URI="https://untroubled.org/bglibs/archive/${P}.tar.gz" + +LICENSE="LGPL-2.1+" +SLOT="0/2" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="doc" + +RDEPEND="" +DEPEND="" +BDEPEND="sys-devel/libtool + doc? ( + app-doc/doxygen + dev-texlive/texlive-latexrecommended + dev-texlive/texlive-latex + dev-texlive/texlive-latexextra + virtual/latex-base + ) +" + +PATCHES=( "${FILESDIR}"/bglibs-2.04-stack-buffers.patch ) + +src_prepare() { + default + # disable tests as we want them manually + sed -i '/^all:/s|selftests||' Makefile || die + sed -i '/selftests/d' TARGETS || die +} + +src_configure() { + echo "${ED}/usr/bin" > conf-bin || die + echo "${ED}/usr/$(get_libdir)/bglibs" > conf-lib || die + echo "${ED}/usr/include" > conf-include || die + echo "${ED}/usr/share/man" > conf-man || die + echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die + echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die +} + +src_compile() { + default + if use doc; then + emake -C doc/latex pdf + fi +} + +src_test() { + einfo "Running selftests" + emake selftests +} + +src_install() { + default + + # Install .so into LDPATH + mv "${ED}"/usr/$(get_libdir)/bglibs/libbg.so.2.0.0 "${ED}"/usr/$(get_libdir)/ || die + dosym libbg.so.2.0.0 /usr/$(get_libdir)/libbg.so.2 + dosym libbg.so.2.0.0 /usr/$(get_libdir)/libbg.so + dosym ../libbg.so.2.0.0 /usr/$(get_libdir)/bglibs/libbg.so.2.0.0 + + rm "${ED}"/usr/$(get_libdir)/bglibs/libbg.la || die + + dodoc ANNOUNCEMENT NEWS README ChangeLog TODO VERSION + dodoc -r doc/html/ + if use doc; then + dodoc doc/latex/refman.pdf + fi +} diff --git a/dev-libs/bglibs/files/bglibs-2.04-stack-buffers.patch b/dev-libs/bglibs/files/bglibs-2.04-stack-buffers.patch new file mode 100644 index 00000000000..6c6fb1133d4 --- /dev/null +++ b/dev-libs/bglibs/files/bglibs-2.04-stack-buffers.patch @@ -0,0 +1,47 @@ +From 25252211283e05c692c8baf3e8a7c70224821762 Mon Sep 17 00:00:00 2001 +From: Rolf Eike Beer +Date: Fri, 15 Nov 2019 19:40:22 +0100 +Subject: [PATCH] properly align the HMAC state buffers on the stack + +They need to have the same alignment as the contained data type, i.e. up to +uint64. Otherwise usage of SHA HMACs causes bus errors on sparc. +--- + crypto/hmac.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/crypto/hmac.c b/crypto/hmac.c +index abff0df..f4e48c0 100644 +--- a/crypto/hmac.c ++++ b/crypto/hmac.c +@@ -34,7 +34,8 @@ void hmac_prepare(const struct hmac_control_block* hcb, + void* midstate, + const str* secret) + { +- unsigned char state[hcb->state_size]; ++ uint64 statebuf[(hcb->state_size + 7) / sizeof(uint64)]; ++ unsigned char *state = (unsigned char *)statebuf; + unsigned char block[hcb->block_size]; + unsigned i; + +@@ -80,8 +81,9 @@ void hmac_finish(const struct hmac_control_block* hcb, + const str* nonce, + void* output) + { +- unsigned char state[hcb->state_size]; +- ++ uint64 statebuf[(hcb->state_size + 7) / sizeof(uint64)]; ++ unsigned char *state = (unsigned char *)statebuf; ++ + /* Generate H1 = H(K XOR ipad, nonce) */ + hcb->inject(state, midstate); + hcb->update(state, (const unsigned char*)nonce->s, nonce->len); +@@ -106,7 +108,8 @@ void hmac(const struct hmac_control_block* hcb, + const str* nonce, + void* output) + { +- unsigned char midstate[hcb->state_size*2]; ++ uint64 statebuf[(hcb->state_size * 2 + 7) / sizeof(uint64)]; ++ unsigned char *midstate = (unsigned char *)statebuf; + + hmac_prepare(hcb, midstate, secret); + hmac_finish(hcb, midstate, nonce, output);