summaryrefslogtreecommitdiff
path: root/sys-apps/dcfldd
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/dcfldd')
-rw-r--r--sys-apps/dcfldd/Manifest2
-rw-r--r--sys-apps/dcfldd/dcfldd-1.9.1-r2.ebuild37
-rw-r--r--sys-apps/dcfldd/files/dcfldd-1.9.1-miscompile.patch44
3 files changed, 83 insertions, 0 deletions
diff --git a/sys-apps/dcfldd/Manifest b/sys-apps/dcfldd/Manifest
index 5dab3ab195b8..aab9499ff6c8 100644
--- a/sys-apps/dcfldd/Manifest
+++ b/sys-apps/dcfldd/Manifest
@@ -1,8 +1,10 @@
+AUX dcfldd-1.9.1-miscompile.patch 1897 BLAKE2B 3f8fc6e328042537bd6f34070d21b510a8829411d13ac9dc86f8017abe6b1d2e6aa10d6793c163fb866344de465c98d282502d122a5776f7cf1e64314a01f43f SHA512 f67f78fb4afe046b0cae03567f42ee1701f2f3ef7222ab1daee866257eafa85b08a025eb68cf33f7286c2d46a651c62c82a9e13ae12a5fdd58d817618d927690
DIST dcfldd-1.8.tar.gz 89853 BLAKE2B c4c492500962bbe5329b2b67387424a99fce9853a9ab8788894e981e8327f5945f9f9ddf8a7bf219e1ff2a506725e2bcee7180e862be09023bef961842b989f0 SHA512 68b1d5806a723a3b499220a007faafb60fd1baa1924511a2e56be41828e2ac517d40e4f53160feb67d5202b25abdf6d304a1e8f100b49594f31dcf0198aaf7da
DIST dcfldd-1.9.1.tar.gz 90536 BLAKE2B 644a96ba193ab0275a805c5bad1bc64fcfc2386c2aace4be1d523d6adb52ded6dc02ec2b0c40f1427772e00f6bef285f0fa515e99fa1793a0e1341916a41bd3a SHA512 bef5dfaa25a51889efcadec101948c4d0e3cbf6ee4a624e4818502bbc78b458310f7b67538946dff927713b7ce6294d269dd3ddba0685fb367988eec582d1f02
DIST dcfldd-1.9.tar.gz 90477 BLAKE2B a594474fea9414e18ba80c1d385f87a19baac49cd09c966fb9b3dac512d7465f376b269e78117e87bc8c797132321227a81689387ef8c13c5e8f2ca4e261cba5 SHA512 675ae32f70206d1027a9687b1b30f6b1d63bcad7dc19219b070b68630721e0bd4cf5e48e7d56d6d5e03c486d6a707f9ff54175ed60e02717219cf38dcb4add37
EBUILD dcfldd-1.8.ebuild 538 BLAKE2B 325317833e1b39bda24ce502c3e32825d4e9cef62361ef81cffd1bb26d68fd9c5e36b4451bf7b54aacf7e448f08b101abd0721d4ec11ebbdcbf0c6ce723bd12c SHA512 73ff0ad486df5b448885de912ddb89e7e88eab06897b7abb44abd228fc1998d07a44a81f8c4488577e6fc596aee41b194e04877c5e54a61ff67d55afc6993758
EBUILD dcfldd-1.9-r1.ebuild 634 BLAKE2B 7a030c0a747ca3d298a92756f2d31ffec97b36f05bae40feb1ea7ce49e914c1df393d7af39d9a1cf338af11dfb12a75dd12262388756bbfc43c3a494ae39990a SHA512 b978291c8de13b570dabdeab0859b6b90833f35e086d5363d49f0eba6d26c411a4edb4f0892d6d6d2e62ac661cc1013ddcc286fda25726f0e89c82d0ccd48ea2
EBUILD dcfldd-1.9.1-r1.ebuild 663 BLAKE2B 6aacc0dd6e1e6b50a4a3ea6e776159439f8b95113b8af7a47e1a9d08f82dec893ec1af556cea075061dd30c0400f807431a603175e29eda26a3bc6191e440412 SHA512 1c9aa1bc93cebe30385e570b5de0fde29c1c3d4a1c58d18668a272be548322987bd97c8125a137acb2b2e8da6de9a5496844196f75fcd7c72c1688f66ca21f0e
+EBUILD dcfldd-1.9.1-r2.ebuild 713 BLAKE2B d8a89e0cdc59a1da1b7dafa49f50eea9ad24f19d94f5518e2e88b91fa75d0f655d7f7a0796d056dd27294bbd6236b013fd79352fc64b09075b9585bfb9b2f1ca SHA512 feae814bf3dc668649af1be550bfdd3a42fcc83e08b5c1fd59dbc7f500118965dbc85df0adf3ad222db29de2ba0179537f6d88cf7da5a1b1cdcf8fd4ec1ebe0a
EBUILD dcfldd-1.9.1.ebuild 634 BLAKE2B 7a030c0a747ca3d298a92756f2d31ffec97b36f05bae40feb1ea7ce49e914c1df393d7af39d9a1cf338af11dfb12a75dd12262388756bbfc43c3a494ae39990a SHA512 b978291c8de13b570dabdeab0859b6b90833f35e086d5363d49f0eba6d26c411a4edb4f0892d6d6d2e62ac661cc1013ddcc286fda25726f0e89c82d0ccd48ea2
MISC metadata.xml 406 BLAKE2B 4b3f919fe88a08eafae29fa536a35c8776adde46ac0243cf1191eef5a2523a96a7f6bedee749b0bc9ba2a32aab79bcaf781497b2f92fe0a7afa6c3b645dca10f SHA512 19bb9687b9bd30914b6f6f1554eaae34dcd48415c022c6b90df7cec8fb85d010dad1edcc4a9299343afe1577ffcb30a23c3cc536eb933ef8066f6b7de112af2f
diff --git a/sys-apps/dcfldd/dcfldd-1.9.1-r2.ebuild b/sys-apps/dcfldd/dcfldd-1.9.1-r2.ebuild
new file mode 100644
index 000000000000..4add47a1a11a
--- /dev/null
+++ b/sys-apps/dcfldd/dcfldd-1.9.1-r2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit autotools bash-completion-r1
+
+DESCRIPTION="enhanced dd with features for forensics and security"
+HOMEPAGE="https://github.com/resurrecting-open-source-projects/dcfldd"
+SRC_URI="https://github.com/resurrecting-open-source-projects/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~riscv ~x86"
+
+DEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-miscompile.patch
+)
+
+DOCS=(
+ AUTHORS
+ CONTRIBUTING.md
+ ChangeLog
+ NEWS
+ README.md
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_install() {
+ default
+ newbashcomp doc/dcfldd-bash_completion dcfldd
+}
diff --git a/sys-apps/dcfldd/files/dcfldd-1.9.1-miscompile.patch b/sys-apps/dcfldd/files/dcfldd-1.9.1-miscompile.patch
new file mode 100644
index 000000000000..2969a8fe9102
--- /dev/null
+++ b/sys-apps/dcfldd/files/dcfldd-1.9.1-miscompile.patch
@@ -0,0 +1,44 @@
+From 393d5c41284292f72f2dd2a3c8e246e972ac718c Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 11 Apr 2024 21:39:36 +0100
+Subject: [PATCH] sha2: fix aliasing violation
+
+`&context->buffer` is `uint8_t*`, but we try to access it as `sha2_word64*`, which
+is an aliasing violation (undefined behaviour).
+
+Use memcpy instead to avoid being miscompiled by e.g. >= GCC 12. This is
+just as fast with any modern compiler.
+
+Bug: https://gcc.gnu.org/PR114698
+Bug: https://github.com/NetBSD/pkgsrc/issues/122
+Bug: https://github.com/archiecobbs/libnbcompat/issues/4
+Bug: https://bugs.launchpad.net/ubuntu-power-systems/+bug/2033405
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ src/sha2.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/sha2.c b/src/sha2.c
+index bea1708..3925b97 100644
+--- a/src/sha2.c
++++ b/src/sha2.c
+@@ -604,7 +604,7 @@ void SHA256_Final(SHA256_CTX* context, sha2_byte digest[]) {
+ *context->buffer = 0x80;
+ }
+ /* Set the bit count: */
+- *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
++ memcpy(&context->buffer[SHA256_SHORT_BLOCK_LENGTH], &context->bitcount, sizeof(context->bitcount));
+
+ /* Final transform: */
+ SHA256_Transform(context, (sha2_word32*)context->buffer);
+@@ -921,8 +921,8 @@ void SHA512_Last(SHA512_CTX* context) {
+ *context->buffer = 0x80;
+ }
+ /* Store the length of input data (in bits): */
+- *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
+- *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
++ memcpy(&context->buffer[SHA512_SHORT_BLOCK_LENGTH], &context->bitcount[1], sizeof(context->bitcount[1]));
++ memcpy(&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8], &context->bitcount[0], sizeof(context->bitcount[0]));
+
+ /* Final transform: */
+ SHA512_Transform(context, (sha2_word64*)context->buffer);