diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-05-05 11:30:40 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-05-05 11:30:40 +0100 |
commit | 3023707d355581e5dc6945aa9c8f4d59e508a8b5 (patch) | |
tree | 5bf569d557ba145002d922f72eadde17410572d4 /app-backup/tarsnap | |
parent | 4e777c0133d093c9c8b992c92e0f244e2055bf71 (diff) |
gentoo auto-resync : 05:05:2023 - 11:30:40
Diffstat (limited to 'app-backup/tarsnap')
-rw-r--r-- | app-backup/tarsnap/Manifest | 4 | ||||
-rw-r--r-- | app-backup/tarsnap/files/tarsnap-1.0.40-strict-aliasing-fix.patch | 158 | ||||
-rw-r--r-- | app-backup/tarsnap/tarsnap-1.0.40-r1.ebuild | 57 | ||||
-rw-r--r-- | app-backup/tarsnap/tarsnap-1.0.40.ebuild | 56 |
4 files changed, 275 insertions, 0 deletions
diff --git a/app-backup/tarsnap/Manifest b/app-backup/tarsnap/Manifest index 469cd86153df..c7076e703ac9 100644 --- a/app-backup/tarsnap/Manifest +++ b/app-backup/tarsnap/Manifest @@ -1,4 +1,8 @@ AUX tarsnap-1.0.39-respect-AR.patch 302 BLAKE2B e03e8b6787697bfab6ef2974cfc248f38eb398512d2e516c8089c676f78c83b390f117a338cacd4d7ef01a2ec13a52bb73210f8b9300b97d9e2ef82391d3bbf1 SHA512 0f35e836abc7e376e9a5fd5e618064667b3ba4415e8280e09b6a9a894ec531bed6ce301d89a6d55dfa14dfb27e98f7d5c53e5b3a7b7cd84fbe9807229c0d5ff1 +AUX tarsnap-1.0.40-strict-aliasing-fix.patch 5146 BLAKE2B 5026b2ec6833d9d50adbff02736e40b1c533e5e257e3686e039efcae3fbdf1af241771d7b0f169ac5b8288d46e76a4d56453dc63f8d2d3b215c861aaf4138f06 SHA512 6d483f269862a627874451ec1433e953b794a299d8c17bc4946d95d6808679bc41aaad9329e5c6bf093ec25f448e3c04d92f2000c22b6372fb82d957f5c403f8 DIST tarsnap-autoconf-1.0.39.tgz 641089 BLAKE2B 4da7fa75c2a6df3186fac4f39a511532ae866c287a2bdc8dcc22049b53fcc903305f84fae9258793bc0c7a47b208d0bf2995143ee7b4296a35b4ca41d65d9a09 SHA512 dec8a72144a3a7fd42b006933c904b812894ca9fe2c57ecc4fbba817b9b49c8f15517530a00b0c3a9897e3182b4d9aee525334537806a9c4f7308086678fa2b4 +DIST tarsnap-autoconf-1.0.40.tgz 723380 BLAKE2B a794bb9bae3637c36841ad4bb0fa1c0e1c39a78ac2dc92f18cbe7dfe1036aa861f5421751dd8a85948dcb101ecb81f2177e844609b289238abd9a8448ba1655a SHA512 a4910c5cbea4a71218638703ba3140e5536a2c9bb7f35007115a7ae4a87fcd07b1be91d88e49240ee8db39be326bac049c0893c1406f215123d55a13b7b57941 EBUILD tarsnap-1.0.39-r1.ebuild 974 BLAKE2B db7c509ba7e4a11481194ab2ac89136116f127c06f6f884d3e1e954df2c082e9e25388fd62460c1c92310ee5a13d47420774c28c163f89476ac8daa3942a81de SHA512 6a38edf81816e64bcb978e01362354f4bbae1b39f1733440576baa6e46a70bde954adeb2f48624362f4271dca59c24c4eac8e6341bafa2648314fe7f9a569abc +EBUILD tarsnap-1.0.40-r1.ebuild 1060 BLAKE2B 0bee535b9caf4db750f267e9d229669c6330b0c752a9c8da25d265cdfd118a11182521013a36501b98dd7374095cd12bb8ae7420d80caafc7bd0ae8f0885b749 SHA512 770239ebd03cf851e235779cc6e4d0bb27763b0aed4867019a3f88af92f986b7777dd8f3f870e346c208d13754d7fbcd702b886c0f7397a65f6d4687d6602255 +EBUILD tarsnap-1.0.40.ebuild 1014 BLAKE2B 5fbeb767bb84928a0c737227cccb90a816e516130202e752f417ebd0efc01e286c69cff52f01c80a8418001deb34057934873a21f29f82cb328791dfe4e27d63 SHA512 696a6460f4ac16de35eb145be1f6f4f6396816afdeedddb5e8f296fb28d330b84faa82ff6913a77cd28f4d196539c1d986ef075584687451eb73ff492d8cbc5e MISC metadata.xml 248 BLAKE2B 98c57e4c0ad56d29830f000cba122733442e4076a7c897c67fa73c38d2bef0e685f2ea515035e8603654b2424f096f759602f20c4ff3acaeea770b0aa235e0b3 SHA512 91d7691f4846ba6fe1b69556e74ed41337287a90b067cc39e0832f3b0a771b2c20e42f832b33f2f2c8519061355c5af7f83afb005f9e28617a6fbfbb650d8091 diff --git a/app-backup/tarsnap/files/tarsnap-1.0.40-strict-aliasing-fix.patch b/app-backup/tarsnap/files/tarsnap-1.0.40-strict-aliasing-fix.patch new file mode 100644 index 000000000000..d168d99222e8 --- /dev/null +++ b/app-backup/tarsnap/files/tarsnap-1.0.40-strict-aliasing-fix.patch @@ -0,0 +1,158 @@ +https://github.com/Tarsnap/tarsnap/commit/ca40c06f290fb8298dc2e583303d45b58878f37b +https://github.com/Tarsnap/tarsnap/commit/4af6d8350ab53d0f1f3104ce3d9072c2d5f9ef7a + +From 4af6d8350ab53d0f1f3104ce3d9072c2d5f9ef7a Mon Sep 17 00:00:00 2001 +From: Graham Percival <gperciva@tarsnap.com> +Date: Fri, 1 Apr 2022 16:58:43 -0700 +Subject: [PATCH] scrypt: Fix strict aliasing + +The original scrypt code treated its data as blobs of bytes, accessing +them in whatever manner was convenient from time to time: + +* as 32-bit words or vectors thereof for the purpose of the Salsa20/8 core +* in machine-word-sized chunks (aka. size_t) for block copy and xor operations +* as 32-bit words for the Integerify function. + +This worked fine at the time, but newer compilers apply strict aliasing rules +which allow them to assume that e.g. data accessed as a uint32_t is not the +same as data accessed as a size_t, resulting in miscompilation. + +Note that in recent versions of scrypt (after 2015-07-18; versions 1.2.0 and +later) such miscompilation should be detected by the built-in runtime testing. + +To avoid aliasing problems, the generic scrypt code now operates on uint32_t +throughout while the SSE2-enabled scrypt code operates on __m128i throughout. + +Experimentally, we found that memcpy() speeds up blkcpy() in the plain C +case, but slowed it down in the _sse2.c case (probably because memcpy +can make use of vector instructions internally, but cannot assume that +it will always have a multiple of 16 bytes, as we do). +--- a/lib/crypto/crypto_scrypt_smix.c ++++ b/lib/crypto/crypto_scrypt_smix.c +@@ -27,39 +27,32 @@ + * online backup system. + */ + #include <stdint.h> ++#include <string.h> + + #include "sysendian.h" + + #include "crypto_scrypt_smix.h" + +-static void blkcpy(void *, const void *, size_t); +-static void blkxor(void *, const void *, size_t); ++static void blkcpy(uint32_t *, const uint32_t *, size_t); ++static void blkxor(uint32_t *, const uint32_t *, size_t); + static void salsa20_8(uint32_t[16]); + static void blockmix_salsa8(const uint32_t *, uint32_t *, uint32_t *, size_t); +-static uint64_t integerify(const void *, size_t); ++static uint64_t integerify(const uint32_t *, size_t); + + static void +-blkcpy(void * dest, const void * src, size_t len) ++blkcpy(uint32_t * dest, const uint32_t * src, size_t len) + { +- size_t * D = dest; +- const size_t * S = src; +- size_t L = len / sizeof(size_t); +- size_t i; + +- for (i = 0; i < L; i++) +- D[i] = S[i]; ++ memcpy(dest, src, len); + } + + static void +-blkxor(void * dest, const void * src, size_t len) ++blkxor(uint32_t * dest, const uint32_t * src, size_t len) + { +- size_t * D = dest; +- const size_t * S = src; +- size_t L = len / sizeof(size_t); + size_t i; + +- for (i = 0; i < L; i++) +- D[i] ^= S[i]; ++ for (i = 0; i < len / 4; i++) ++ dest[i] ^= src[i]; + } + + /** +@@ -145,9 +138,9 @@ blockmix_salsa8(const uint32_t * Bin, uint32_t * Bout, uint32_t * X, size_t r) + * Return the result of parsing B_{2r-1} as a little-endian integer. + */ + static uint64_t +-integerify(const void * B, size_t r) ++integerify(const uint32_t * B, size_t r) + { +- const uint32_t * X = (const void *)((uintptr_t)(B) + (2 * r - 1) * 64); ++ const uint32_t * X = B + (2 * r - 1) * 16; + + return (((uint64_t)(X[1]) << 32) + X[0]); + } +--- a/lib/crypto/crypto_scrypt_smix_sse2.c ++++ b/lib/crypto/crypto_scrypt_smix_sse2.c +@@ -36,34 +36,30 @@ + + #include "crypto_scrypt_smix_sse2.h" + +-static void blkcpy(void *, const void *, size_t); +-static void blkxor(void *, const void *, size_t); ++static void blkcpy(__m128i *, const __m128i *, size_t); ++static void blkxor(__m128i *, const __m128i *, size_t); + static void salsa20_8(__m128i[4]); + static void blockmix_salsa8(const __m128i *, __m128i *, __m128i *, size_t); +-static uint64_t integerify(const void *, size_t); ++static uint64_t integerify(const __m128i *, size_t); + + static void +-blkcpy(void * dest, const void * src, size_t len) ++blkcpy(__m128i * dest, const __m128i * src, size_t len) + { +- __m128i * D = dest; +- const __m128i * S = src; + size_t L = len / 16; + size_t i; + + for (i = 0; i < L; i++) +- D[i] = S[i]; ++ dest[i] = src[i]; + } + + static void +-blkxor(void * dest, const void * src, size_t len) ++blkxor(__m128i * dest, const __m128i * src, size_t len) + { +- __m128i * D = dest; +- const __m128i * S = src; + size_t L = len / 16; + size_t i; + + for (i = 0; i < L; i++) +- D[i] = _mm_xor_si128(D[i], S[i]); ++ dest[i] = _mm_xor_si128(dest[i], src[i]); + } + + /** +@@ -168,11 +164,18 @@ blockmix_salsa8(const __m128i * Bin, __m128i * Bout, __m128i * X, size_t r) + * Note that B's layout is permuted compared to the generic implementation. + */ + static uint64_t +-integerify(const void * B, size_t r) ++integerify(const __m128i * B, size_t r) + { +- const uint32_t * X = (const void *)((uintptr_t)(B) + (2 * r - 1) * 64); ++ const __m128i * X = B + (2*r - 1) * 4; ++ uint32_t X0, X13; + +- return (((uint64_t)(X[13]) << 32) + X[0]); ++ /* Get the first 32-bit element in X[0]. */ ++ X0 = (uint32_t)_mm_cvtsi128_si32(X[0]); ++ ++ /* Get the second 32-bit element in X[3]. */ ++ X13 = (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(X[3], 4)); ++ ++ return (((uint64_t)(X13) << 32) + X0); + } + + /** diff --git a/app-backup/tarsnap/tarsnap-1.0.40-r1.ebuild b/app-backup/tarsnap/tarsnap-1.0.40-r1.ebuild new file mode 100644 index 000000000000..3adbe02afcf0 --- /dev/null +++ b/app-backup/tarsnap/tarsnap-1.0.40-r1.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit bash-completion-r1 toolchain-funcs + +DESCRIPTION="Online backups for the truly paranoid" +HOMEPAGE="https://www.tarsnap.com/" +SRC_URI="https://www.tarsnap.com/download/${PN}-autoconf-${PV}.tgz" +S="${WORKDIR}"/${PN}-autoconf-${PV} + +LICENSE="tarsnap" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="acl bzip2 lzma xattr" + +RDEPEND=" + dev-libs/openssl:= + sys-fs/e2fsprogs + sys-libs/zlib + acl? ( sys-apps/acl ) + bzip2? ( app-arch/bzip2 ) + lzma? ( app-arch/xz-utils ) + xattr? ( sys-apps/attr ) +" +# Required for "magic.h" +DEPEND=" + ${RDEPEND} + virtual/os-headers +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.0.39-respect-AR.patch + "${FILESDIR}"/${P}-strict-aliasing-fix.patch +) + +src_configure() { + local myeconfargs=( + $(use_enable xattr) + $(use_enable acl) + $(use_with bzip2 bz2lib) + --without-lzmadec + $(use_with lzma) + ) + + econf "${myeconfargs[@]}" +} + +src_compile() { + emake AR="$(tc-getAR)" +} + +src_install() { + default + dobashcomp misc/bash_completion.d/* +} diff --git a/app-backup/tarsnap/tarsnap-1.0.40.ebuild b/app-backup/tarsnap/tarsnap-1.0.40.ebuild new file mode 100644 index 000000000000..ebf35c72ced2 --- /dev/null +++ b/app-backup/tarsnap/tarsnap-1.0.40.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit bash-completion-r1 toolchain-funcs + +DESCRIPTION="Online backups for the truly paranoid" +HOMEPAGE="https://www.tarsnap.com/" +SRC_URI="https://www.tarsnap.com/download/${PN}-autoconf-${PV}.tgz" +S="${WORKDIR}"/${PN}-autoconf-${PV} + +LICENSE="tarsnap" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="acl bzip2 lzma xattr" + +RDEPEND=" + dev-libs/openssl:= + sys-fs/e2fsprogs + sys-libs/zlib + acl? ( sys-apps/acl ) + bzip2? ( app-arch/bzip2 ) + lzma? ( app-arch/xz-utils ) + xattr? ( sys-apps/attr ) +" +# Required for "magic.h" +DEPEND=" + ${RDEPEND} + virtual/os-headers +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.0.39-respect-AR.patch +) + +src_configure() { + local myeconfargs=( + $(use_enable xattr) + $(use_enable acl) + $(use_with bzip2 bz2lib) + --without-lzmadec + $(use_with lzma) + ) + + econf "${myeconfargs[@]}" +} + +src_compile() { + emake AR="$(tc-getAR)" +} + +src_install() { + default + dobashcomp misc/bash_completion.d/* +} |