Contact Details
byron@introspicion.com
Version
v5.7.2-stable (github clone)
Description
Using the configuration indicated in the attached wolfssl.config.log, a simple encryption of a 14-byte text buffer writes 12 bytes beyond the end of the ChaCha struct. In function wc_Chacha_encrypt_64, inline assembly at line 2181 begins writing at 4 bytes from the end of the ChaCha struct, and writes at least 8 bytes too far (corrupting a pointer that happens to be located there in my code). Aligning the ChaCha struct to 16 bytes on the stack did not make any difference. It appears the assembly instruction at line 2181 is the wrong variant for variable over. Rebuilding with --enable-armasm=no resolves the problem.
wolfssl.config.log
Reproduction steps
- ./configure --enable-curl=yes --build x86_64-linux-gnu --host aarch64 --with-arm-target=cortex --enable-armasm --enable-chacha=yes
- build and run any basic encryption step
- buffer overflow corrupts memory following the ChaCha struct
Relevant log output
Configuration log is large, so it is attached instead.
Contact Details
byron@introspicion.com
Version
v5.7.2-stable (github clone)
Description
Using the configuration indicated in the attached
wolfssl.config.log, a simple encryption of a 14-byte text buffer writes 12 bytes beyond the end of the ChaCha struct. In functionwc_Chacha_encrypt_64, inline assembly at line 2181 begins writing at 4 bytes from the end of the ChaCha struct, and writes at least 8 bytes too far (corrupting a pointer that happens to be located there in my code). Aligning the ChaCha struct to 16 bytes on the stack did not make any difference. It appears the assembly instruction at line 2181 is the wrong variant for variableover. Rebuilding with--enable-armasm=noresolves the problem.wolfssl.config.log
Reproduction steps
Relevant log output