Do not silently truncate files on perlasm errors
authorDavid Benjamin <davidben@google.com>
Mon, 17 Feb 2020 02:21:27 +0000 (12:21 +1000)
committerPauli <paul.dale@oracle.com>
Mon, 17 Feb 2020 02:21:27 +0000 (12:21 +1000)
commit218e740f850f77c9f2720d56886eab166d1a6727
treef1691e347bca452b568a9df238f15098d95ba88c
parent57225c99ef848f0d0d1a7ab586a61ef71740f1ff
Do not silently truncate files on perlasm errors

If one of the perlasm xlate drivers crashes, OpenSSL's build will
currently swallow the error and silently truncate the output to however
far the driver got. This will hopefully fail to build, but better to
check such things.

Handle this by checking for errors when closing STDOUT (which is a pipe
to the xlate driver).

This is the OpenSSL 1.1.1 version of
https://github.com/openssl/openssl/pull/10883 and
https://github.com/openssl/openssl/pull/10930.

Reviewed-by: Mark J. Cox <mark@awe.com>
Reviewed-by: Paul Dale David Benjamin <davidben@google.com>
(Merged from https://github.com/openssl/openssl/pull/10931)
160 files changed:
crypto/aes/asm/aes-armv4.pl
crypto/aes/asm/aes-c64xplus.pl
crypto/aes/asm/aes-mips.pl
crypto/aes/asm/aes-parisc.pl
crypto/aes/asm/aes-ppc.pl
crypto/aes/asm/aes-s390x.pl
crypto/aes/asm/aes-sparcv9.pl
crypto/aes/asm/aesfx-sparcv9.pl
crypto/aes/asm/aesni-mb-x86_64.pl
crypto/aes/asm/aesni-sha1-x86_64.pl
crypto/aes/asm/aesni-sha256-x86_64.pl
crypto/aes/asm/aesni-x86.pl
crypto/aes/asm/aesni-x86_64.pl
crypto/aes/asm/aesp8-ppc.pl
crypto/aes/asm/aest4-sparcv9.pl
crypto/aes/asm/aesv8-armx.pl
crypto/aes/asm/bsaes-armv7.pl
crypto/aes/asm/vpaes-armv8.pl
crypto/aes/asm/vpaes-ppc.pl
crypto/aes/asm/vpaes-x86.pl
crypto/aes/asm/vpaes-x86_64.pl
crypto/alphacpuid.pl
crypto/arm64cpuid.pl
crypto/armv4cpuid.pl
crypto/bf/asm/bf-586.pl
crypto/bn/asm/alpha-mont.pl
crypto/bn/asm/armv4-gf2m.pl
crypto/bn/asm/armv4-mont.pl
crypto/bn/asm/armv8-mont.pl
crypto/bn/asm/bn-586.pl
crypto/bn/asm/c64xplus-gf2m.pl
crypto/bn/asm/co-586.pl
crypto/bn/asm/ia64-mont.pl
crypto/bn/asm/mips-mont.pl
crypto/bn/asm/mips.pl
crypto/bn/asm/parisc-mont.pl
crypto/bn/asm/ppc-mont.pl
crypto/bn/asm/ppc.pl
crypto/bn/asm/ppc64-mont.pl
crypto/bn/asm/rsaz-avx2.pl
crypto/bn/asm/rsaz-x86_64.pl
crypto/bn/asm/s390x-gf2m.pl
crypto/bn/asm/s390x-mont.pl
crypto/bn/asm/sparct4-mont.pl
crypto/bn/asm/sparcv9-gf2m.pl
crypto/bn/asm/sparcv9-mont.pl
crypto/bn/asm/sparcv9a-mont.pl
crypto/bn/asm/via-mont.pl
crypto/bn/asm/vis3-mont.pl
crypto/bn/asm/x86-gf2m.pl
crypto/bn/asm/x86-mont.pl
crypto/bn/asm/x86_64-gf2m.pl
crypto/bn/asm/x86_64-mont.pl
crypto/bn/asm/x86_64-mont5.pl
crypto/c64xpluscpuid.pl
crypto/camellia/asm/cmll-x86.pl
crypto/camellia/asm/cmll-x86_64.pl
crypto/camellia/asm/cmllt4-sparcv9.pl
crypto/cast/asm/cast-586.pl
crypto/chacha/asm/chacha-armv4.pl
crypto/chacha/asm/chacha-armv8.pl
crypto/chacha/asm/chacha-c64xplus.pl
crypto/chacha/asm/chacha-ppc.pl
crypto/chacha/asm/chacha-s390x.pl
crypto/chacha/asm/chacha-x86.pl
crypto/chacha/asm/chacha-x86_64.pl
crypto/des/asm/crypt586.pl
crypto/des/asm/des-586.pl
crypto/des/asm/dest4-sparcv9.pl
crypto/ec/asm/ecp_nistz256-armv4.pl
crypto/ec/asm/ecp_nistz256-armv8.pl
crypto/ec/asm/ecp_nistz256-avx2.pl
crypto/ec/asm/ecp_nistz256-ppc64.pl
crypto/ec/asm/ecp_nistz256-sparcv9.pl
crypto/ec/asm/ecp_nistz256-x86.pl
crypto/ec/asm/ecp_nistz256-x86_64.pl
crypto/ec/asm/x25519-ppc64.pl
crypto/ec/asm/x25519-x86_64.pl
crypto/md5/asm/md5-586.pl
crypto/md5/asm/md5-sparcv9.pl
crypto/md5/asm/md5-x86_64.pl
crypto/modes/asm/aesni-gcm-x86_64.pl
crypto/modes/asm/ghash-alpha.pl
crypto/modes/asm/ghash-armv4.pl
crypto/modes/asm/ghash-c64xplus.pl
crypto/modes/asm/ghash-ia64.pl
crypto/modes/asm/ghash-parisc.pl
crypto/modes/asm/ghash-s390x.pl
crypto/modes/asm/ghash-sparcv9.pl
crypto/modes/asm/ghash-x86.pl
crypto/modes/asm/ghash-x86_64.pl
crypto/modes/asm/ghashp8-ppc.pl
crypto/modes/asm/ghashv8-armx.pl
crypto/pariscid.pl
crypto/perlasm/arm-xlate.pl
crypto/perlasm/ppc-xlate.pl
crypto/perlasm/x86_64-xlate.pl
crypto/poly1305/asm/poly1305-armv4.pl
crypto/poly1305/asm/poly1305-armv8.pl
crypto/poly1305/asm/poly1305-mips.pl
crypto/poly1305/asm/poly1305-ppc.pl
crypto/poly1305/asm/poly1305-ppcfp.pl
crypto/poly1305/asm/poly1305-s390x.pl
crypto/poly1305/asm/poly1305-sparcv9.pl
crypto/poly1305/asm/poly1305-x86.pl
crypto/poly1305/asm/poly1305-x86_64.pl
crypto/ppccpuid.pl
crypto/rc4/asm/rc4-586.pl
crypto/rc4/asm/rc4-c64xplus.pl
crypto/rc4/asm/rc4-md5-x86_64.pl
crypto/rc4/asm/rc4-parisc.pl
crypto/rc4/asm/rc4-s390x.pl
crypto/rc4/asm/rc4-x86_64.pl
crypto/rc5/asm/rc5-586.pl
crypto/ripemd/asm/rmd-586.pl
crypto/s390xcpuid.pl
crypto/sha/asm/keccak1600-armv4.pl
crypto/sha/asm/keccak1600-armv8.pl
crypto/sha/asm/keccak1600-avx2.pl
crypto/sha/asm/keccak1600-avx512.pl
crypto/sha/asm/keccak1600-avx512vl.pl
crypto/sha/asm/keccak1600-c64x.pl
crypto/sha/asm/keccak1600-mmx.pl
crypto/sha/asm/keccak1600-ppc64.pl
crypto/sha/asm/keccak1600-s390x.pl
crypto/sha/asm/keccak1600-x86_64.pl
crypto/sha/asm/keccak1600p8-ppc.pl
crypto/sha/asm/sha1-586.pl
crypto/sha/asm/sha1-alpha.pl
crypto/sha/asm/sha1-armv4-large.pl
crypto/sha/asm/sha1-armv8.pl
crypto/sha/asm/sha1-c64xplus.pl
crypto/sha/asm/sha1-mb-x86_64.pl
crypto/sha/asm/sha1-mips.pl
crypto/sha/asm/sha1-parisc.pl
crypto/sha/asm/sha1-ppc.pl
crypto/sha/asm/sha1-s390x.pl
crypto/sha/asm/sha1-sparcv9.pl
crypto/sha/asm/sha1-sparcv9a.pl
crypto/sha/asm/sha1-thumb.pl
crypto/sha/asm/sha1-x86_64.pl
crypto/sha/asm/sha256-586.pl
crypto/sha/asm/sha256-armv4.pl
crypto/sha/asm/sha256-c64xplus.pl
crypto/sha/asm/sha256-mb-x86_64.pl
crypto/sha/asm/sha512-586.pl
crypto/sha/asm/sha512-armv4.pl
crypto/sha/asm/sha512-armv8.pl
crypto/sha/asm/sha512-c64xplus.pl
crypto/sha/asm/sha512-mips.pl
crypto/sha/asm/sha512-parisc.pl
crypto/sha/asm/sha512-ppc.pl
crypto/sha/asm/sha512-s390x.pl
crypto/sha/asm/sha512-sparcv9.pl
crypto/sha/asm/sha512-x86_64.pl
crypto/sha/asm/sha512p8-ppc.pl
crypto/whrlpool/asm/wp-mmx.pl
crypto/whrlpool/asm/wp-x86_64.pl
crypto/x86_64cpuid.pl
crypto/x86cpuid.pl