• jitterentropy-rngd woes on armel

    From Christoph Biedl@21:1/5 to All on Sat Jun 26 20:50:01 2021
    [ jitterentropy-rngd maintainer Cc'ed ]

    Hello,

    can please somebody check the armel jitterentropy-rngd package in
    testing and unstable (1.2.1-2) on various arm platforms? Things look
    really weird and I have no idea how to proceed.

    Initial observation: On an old Seagate Dockstar (Feroceon 88FR131, armv5tel CPU) running Debian bullseye (buster is fine), jitterentropy-rngd ("je-r") fails to start:

    # jitterentropy-rngd
    Floating point exception

    Using gdb:

    Program received signal SIGFPE, Arithmetic exception.
    0xb6fb6810 in raise () from /lib/arm-linux-gnueabi/libpthread.so.0
    (gdb) bt
    #0 0xb6fb6810 in raise () from /lib/arm-linux-gnueabi/libpthread.so.0
    #1 0x00404968 in __aeabi_ldiv0 ()
    #2 0x00402664 in sha3_update (ctx=0xbefff55c, in=0x404b50 <msg_256> "^", <incomplete sequence \326>,
    inlen=3) at jitterentropy-base.c:567
    #3 0x00402d48 in sha3_tester () at jitterentropy-base.c:658
    #4 0x004038dc in jent_entropy_init () at jitterentropy-base.c:1387
    #5 0x00400ffc in alloc () at jitterentropy-rngd.c:666
    #6 main (argc=1, argv=0xbefff914) at jitterentropy-rngd.c:794

    So this is most likely caused by

    size_t partial = ctx->msg_len % ctx->r;


    Surprise however: In an armel bullseye chroot on both a Cubietruck
    (armhf) and Raspberry Pi 4 (arm64), je-r just runs fine.

    And running a rebuilt je-r on the Dockstar yields a completely different message:

    jitterentropy-rngd - Error: The initialization of CPU Jitter RNG failed with error code 11

    Adding some debug print statements reveals this is caused from a fail in sha3_tester, and indeed the computed hash is different. But the line
    that initially caused trouble is passed.


    Possibly unrelated, the gcc warnings (line number are a bit off)

    jitterentropy-base.c: In function ‘sha3_tester’:
    jitterentropy-base.c:311:25: warning: cast increases required alignment of target type [-Wcast-align]
    311 | struct sha_ctx *name = (struct sha_ctx *) name ## _ctx_buf
    | ^
    jitterentropy-base.c:649:2: note: in expansion of macro ‘HASH_CTX_ON_STACK’
    649 | HASH_CTX_ON_STACK(ctx);
    | ^~~~~~~~~~~~~~~~~

    don't look good but I fail to understand the root cause behind this.
    Applying some #pragma pack made the warnings go away, the issue
    remained, though.

    Any idea?

    Christoph

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEWXMI+726A12MfJXdxCxY61kUkv0FAmDXdUYACgkQxCxY61kU kv0ifg/+NK5J6NWuosMwQF5k2STpllGeUqEMRsdc7Nfu+3AluZtP1uJZi7aw2W4u nhN7zfDEtP0iC2LT0p41NVw2z+nUJdBmdhyfF/fv6AkzPN4iDPqxEOFn7z7xqsfr yPN6CxR056aXyahtfYGxzE9ApRr9ic8uhZP6qQ2u3fonXjCLzFtt/oHOda35R7yV xCW3qa6aXscLVsm34eI7uxk2B3/o2UqGufMwnS+pZFRd7e0npFTTcva66/NDErUU NU0JrCfYGlWBSPFC+7aeBH0pzW5xypz7tnHQJc5zT2DrdKevAV4RqHdTj75M1Zl8 w8JnZseFrInI8oj8YO/glr8PNrwoM+lS6WDh/QPsHlKZ41taq3jap68pNtYdYd4R TBmmxMAqTzeNjv2jfB5jhfFcjG2L7hkf661ZFOwWz48nBrwr7XYxge0nOgqmCzFc D3VULejkfpPDddQgM4r2wY9ulCEdixhdjerMl1b8yCPn0fsgBtVCTv5urE5YQTxz c3p0VxZIf6voBrT0zmrHDK1farzjjyLUXJNKrJUiphwsmBFZTs4UrdJaDVrU2A+S mYmbUFzMJZHbL0SRuypDEN/dm/ZVkO7r+sp5woEDTLeBJLppBI1JovHFCNXKYAsj NYgnBi17G4ncE4z2EiLcEBp9AQAtu2sLL1hzVLhDN5Zm8HVb72M=
    =2+Ym
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Adrian Bunk@21:1/5 to Christoph Biedl on Sun Jul 4 15:40:01 2021
    On Sat, Jun 26, 2021 at 08:43:22PM +0200, Christoph Biedl wrote:
    ...
    can please somebody check the armel jitterentropy-rngd package in
    testing and unstable (1.2.1-2) on various arm platforms? Things look
    really weird and I have no idea how to proceed.

    Initial observation: On an old Seagate Dockstar (Feroceon 88FR131, armv5tel CPU) running Debian bullseye (buster is fine), jitterentropy-rngd ("je-r") fails to start:

    # jitterentropy-rngd
    Floating point exception

    Using gdb:

    Program received signal SIGFPE, Arithmetic exception.
    0xb6fb6810 in raise () from /lib/arm-linux-gnueabi/libpthread.so.0
    (gdb) bt
    #0 0xb6fb6810 in raise () from /lib/arm-linux-gnueabi/libpthread.so.0
    #1 0x00404968 in __aeabi_ldiv0 ()
    #2 0x00402664 in sha3_update (ctx=0xbefff55c, in=0x404b50 <msg_256> "^", <incomplete sequence \326>,
    inlen=3) at jitterentropy-base.c:567
    #3 0x00402d48 in sha3_tester () at jitterentropy-base.c:658
    #4 0x004038dc in jent_entropy_init () at jitterentropy-base.c:1387
    #5 0x00400ffc in alloc () at jitterentropy-rngd.c:666
    #6 main (argc=1, argv=0xbefff914) at jitterentropy-rngd.c:794

    So this is most likely caused by

    size_t partial = ctx->msg_len % ctx->r;


    Surprise however: In an armel bullseye chroot on both a Cubietruck
    (armhf) and Raspberry Pi 4 (arm64), je-r just runs fine.

    And running a rebuilt je-r on the Dockstar yields a completely different message:

    jitterentropy-rngd - Error: The initialization of CPU Jitter RNG failed with error code 11

    Adding some debug print statements reveals this is caused from a fail in sha3_tester, and indeed the computed hash is different. But the line
    that initially caused trouble is passed.


    Possibly unrelated, the gcc warnings (line number are a bit off)

    jitterentropy-base.c: In function ‘sha3_tester’:
    jitterentropy-base.c:311:25: warning: cast increases required alignment of target type [-Wcast-align]
    311 | struct sha_ctx *name = (struct sha_ctx *) name ## _ctx_buf
    | ^
    jitterentropy-base.c:649:2: note: in expansion of macro ‘HASH_CTX_ON_STACK’
    649 | HASH_CTX_ON_STACK(ctx);
    | ^~~~~~~~~~~~~~~~~

    don't look good but I fail to understand the root cause behind this.
    Applying some #pragma pack made the warnings go away, the issue
    remained, though.

    Any idea?

    This sounds similar to other problems reported on armv5tel:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975977#44
    https://bugs.debian.org/987566

    I've added Bernhard to Cc, who has done most of the investigation
    work on these bugs.

    Christoph

    cu
    Adrian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)