[PATCH] sha3sum: New applet, v2

Lauri Kasanen curaga at operamail.com
Sun Jan 6 15:39:11 UTC 2013


> > > Well, as mentioned, I don't have such a system. Could you do a debug
> > > build (CONFIG_DEBUG=y) and get valgrind output?
> > > 
> > > echo test | valgrind ./busybox_unstripped sha3sum
> > 
> > Unfortunately, valgrind does not support this PowerPC variant (e500v2).  I'll 
> > try gdb and see what I get.
> 
> Here it is:
> 
> (gdb) target remote 192.168.26.170:1234
> Remote debugging using 192.168.26.170:1234
> 0x10001f9c in _start ()
> (gdb) c
> Continuing.
> 
> Program received signal SIGSEGV, Segmentation fault.
> KeccakF (state=0xbf8d1f30, in=<value optimized out>, laneCount=8)
>     at libbb/hash_md5_sha.c:977
> 977         state[laneCount] ^= SWAP_LE64(in[laneCount]);
> (gdb) bt
> #0  KeccakF (state=0xbf8d1f30, in=<value optimized out>, laneCount=8)
>     at libbb/hash_md5_sha.c:977
> #1  0x10051474 in sha3_hash (state=0xbf8d1f30, data=0x10172fd0 "", 
>     bytes=<value optimized out>) at libbb/hash_md5_sha.c:1055
> #2  0x1003b544 in hash_file (filename=<value optimized out>)
>     at coreutils/md5_sha1_sum.c:151
> #3  0x1003b7c4 in md5_sha1_sum_main (argc=<value optimized out>, 
>     argv=<value optimized out>) at coreutils/md5_sha1_sum.c:247

Both state[8] and in[8] have to be valid at that point, there's no way
from the code for them to have less size than 200 and 72 respectively.

So it looks to me that the swap_le64 itself is crashing, but I'm not
sure about that, it should be a GCC builtin. Alternatively, does your
platform crash from unaligned access? State is 32-bit aligned currently,
not 64.

Can you try changing the alignment at include/libbb.h lines 1639 and
1640?

- Lauri

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own



More information about the busybox mailing list