ARM user regression since 87b74e8b
Since 87b74e8b (including v6 and master), I'm having trouble with crashes when running a static i686 qemu-arm on an amd64 host.
I'm building on Ubuntu 20.04.2 with ./configure --disable-tools --target-list=arm-linux-user --static --cpu=i686 --cross-prefix=i686-linux-gnu- --disable-pie && make
Then when running wget
on an HTTPS URL in an armhf chroot, it errors out:
# ./qemu-arm --version
qemu-arm version 4.2.50 (v4.2.0-1698-g7abc8cabad-dirty)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
# ./qemu-arm-bad --version
qemu-arm version 4.2.50 (v4.2.0-1699-g87b74e8b6e-dirty)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
# ./qemu-arm-bad /usr/bin/wget https://github.com -O /dev/null
--2021-06-02 15:11:57-- https://github.com/
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
ERROR: The certificate of ‘github.com’ is not trusted.
ERROR: The certificate of ‘github.com’ doesn't have a known issuer.
# ./qemu-arm /usr/bin/wget https://github.com -O /dev/null
--2021-06-02 15:12:05-- https://github.com/
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/dev/null’
/dev/null [ <=> ] 222.77K --.-KB/s in 0.05s
2021-06-02 15:12:05 (4.58 MB/s) - ‘/dev/null’ saved [228113]
apt-get update
also behaves oddly depending which commit after 87b74e8b I'm on. In some cases, it errors out saying the signatures are invalid, in others it doesn't but then the lists don't end up in the expected directory leading to other errors when trying to install something.
Edit:
The errors seemed to be happening inside the nettle library, so I ran their testsuite. It passes before that commit, but if I pull it in then I get quite a few failures:
# make check
/usr/bin/make check-here
make[1]: Entering directory '/root/nettle-3.4.1/build'
true
make[1]: Leaving directory '/root/nettle-3.4.1/build'
set -e; for d in tools testsuite examples; do \
echo "Making check in $d" ; (cd $d && /usr/bin/make check); done
Making check in tools
make[1]: Entering directory '/root/nettle-3.4.1/build/tools'
true
make[1]: Leaving directory '/root/nettle-3.4.1/build/tools'
Making check in testsuite
make[1]: Entering directory '/root/nettle-3.4.1/build/testsuite'
LD_LIBRARY_PATH=../.lib PATH="../.lib:$PATH" DYLD_LIBRARY_PATH=../.lib \
srcdir="../../testsuite" \
EMULATOR="" NM="nm" EXEEXT="" \
../../run-tests aes-test arcfour-test arctwo-test blowfish-test cast128-test base16-test base64-test camellia-test chacha-test cnd-memcpy-test des-test des3-test des-compat-test md2-test md4-test md5-test md5-compat-test memeql-test memxor-test gosthash94-test ripemd160-test hkdf-test salsa20-test sha1-test sha224-test sha256-test sha384-test sha512-test sha512-224-test sha512-256-test sha3-permute-test sha3-224-test sha3-256-test sha3-384-test sha3-512-test serpent-test twofish-test version-test knuth-lfib-test cbc-test cfb-test ctr-test gcm-test eax-test ccm-test poly1305-test chacha-poly1305-test hmac-test umac-test meta-hash-test meta-cipher-test meta-aead-test meta-armor-test buffer-test yarrow-test pbkdf2-test cxx-test sexp-conv-test pkcs1-conv-test nettle-pbkdf2-test symbols-test dlopen-test
PASS: aes
PASS: arcfour
PASS: arctwo
PASS: blowfish
PASS: cast128
PASS: base16
Assert failed: ../../testsuite/base64-test.c:35: MEMEQ(size, input, decoded)
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: base64
PASS: camellia
Error, length 40, expected:
76b8e0ada0f13d90 405d6ae55386bd28
bdd219b8a08ded1a a836efcc8b770dc7
da41597c5157488d
Got:
76b8e0ada0f13d90 405d6ae55386bd28
bdd219b8a08ded1a a836efcc8b770dc7
da41597c5157488d
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: chacha
Assert failed: ../../testsuite/cnd-memcpy-test.c:43: memcmp (res, dst, size) == 0
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: cnd-memcpy
PASS: des
PASS: des3
PASS: des-compat
PASS: md2
PASS: md4
PASS: md5
PASS: md5-compat
PASS: memeql
Assert failed: ../../testsuite/memxor-test.c:71: MEMEQ (size, dst, c)
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: memxor
PASS: gosthash94
PASS: ripemd160
PASS: hkdf
Error failed, offset 0:
Output:
4dfa5e481da23ea0 9a31022050859936
da52fcee21800516 4f267cb65f5cfd7f
2b4f97e0ff16924a 52df269515110a07
f9e460bc65ef95da 58f740b7d1dbb0aa
Expected:
4dfa5e481da23ea0 9a31022050859936
da52fcee21800516 4f267cb65f5cfd7f
2b4f97e0ff16924a 52df269515110a07
f9e460bc65ef95da 58f740b7d1dbb0aa
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: salsa20
PASS: sha1
PASS: sha224
PASS: sha256
PASS: sha384
PASS: sha512
PASS: sha512-224
PASS: sha512-256
PASS: sha3-permute
PASS: sha3-224
PASS: sha3-256
PASS: sha3-384
PASS: sha3-512
PASS: serpent
PASS: twofish
PASS: version
PASS: knuth-lfib
PASS: cbc
PASS: cfb
PASS: ctr
PASS: gcm
PASS: eax
PASS: ccm
PASS: poly1305
PASS: chacha-poly1305
Assert failed: ../../testsuite/hmac-test.c:638: MEMEQ ((tstring_hex("afd03944d84895626b0825f4ab46907f" "15f9dadbe4101ec682aa034c7cebc59c" "faea9ea9076ede7f4af152e8b2fa9cb6"))->length, digest, (tstring_hex("afd03944d84895626b0825f4ab46907f" "15f9dadbe4101ec682aa034c7cebc59c" "faea9ea9076ede7f4af152e8b2fa9cb6"))->data)
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: hmac
PASS: umac
PASS: meta-hash
PASS: meta-cipher
PASS: meta-aead
PASS: meta-armor
PASS: buffer
PASS: yarrow
Assert failed: ../../testsuite/pbkdf2-test.c:93: MEMEQ ((tstring_hex("73decfa58aa2e84f94771a75736bb88bd3c7b38270cfb50cb390ed78b305656af8148e52452b2216b2b8098b761fc6336060a09f76415e9f71ea47f9e9064306"))->length, dk, (tstring_hex("73decfa58aa2e84f94771a75736bb88bd3c7b38270cfb50cb390ed78b305656af8148e52452b2216b2b8098b761fc6336060a09f76415e9f71ea47f9e9064306"))->data)
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
FAIL: pbkdf2
PASS: cxx
PASS: sexp-conv
SKIP: pkcs1-conv
PASS: nettle-pbkdf2
PASS: symbols
PASS: dlopen
====================
7 of 61 tests failed
====================
make[1]: *** [Makefile:140: check] Error 1
make[1]: Leaving directory '/root/nettle-3.4.1/build/testsuite'
make: *** [Makefile:50: check] Error 2
Edit 2:
Just got it into a state where wget and nettle seem to work without any issues - it just seemed to start working randomly. apt-get update
still didn't work. So this might not be easily reproducible. Happy to provide any debug output that might be helpful when it happens again.