Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20250103-Sha512Final-no-scratch-digest #8329

Merged

Conversation

douzzer
Copy link
Contributor

@douzzer douzzer commented Jan 3, 2025

wolfcrypt/src/sha512.c: in Sha512FinalRaw() and wc_Sha384FinalRaw(), refactor out the scratch digest -- ByteReverseWords64() is safe in-place, and the scratch digest caused a SEGV in the XMEMCPY() on AVX512-capable targets built with gcc -march=native -O2 unless XALIGN(64), due to gcc bug(s).

Note, the bug only manifests in ASAN builds, repro'd on gcc-13, gcc-14, and gcc-15. Regular -O2 build passes unit.test without this patch.

tested with wolfssl-multi-test.sh check-source-text sp-all-asm-sanitizer on an AVX512 target.

@douzzer douzzer requested a review from SparkiDev January 3, 2025 17:54
@douzzer douzzer assigned douzzer, SparkiDev and wolfSSL-Bot and unassigned douzzer Jan 3, 2025
wolfcrypt/src/sha512.c Outdated Show resolved Hide resolved
@SparkiDev SparkiDev assigned douzzer and unassigned SparkiDev Jan 5, 2025
…refactor out the scratch digest -- ByteReverseWords64() is safe in-place, and the scratch digest caused a SEGV in the XMEMCPY() on AVX512-capable targets built with gcc -march=native unless XALIGN(64), due to gcc bug(s).
@douzzer douzzer force-pushed the 20250103-Sha512Final-no-scratch-digest branch from 810a46c to 5172ff7 Compare January 6, 2025 17:09
@douzzer douzzer requested a review from SparkiDev January 6, 2025 17:11
@douzzer douzzer assigned SparkiDev and unassigned douzzer Jan 6, 2025
@douzzer
Copy link
Contributor Author

douzzer commented Jan 6, 2025

retest this please (timeouts on PRB-fips-ready-config Windows subtests)

@douzzer
Copy link
Contributor Author

douzzer commented Jan 7, 2025

retest this please (Windows worker node glitch now fixed)

@douzzer douzzer removed their assignment Jan 7, 2025
@dgarske dgarske merged commit d2ea3c6 into wolfSSL:master Jan 7, 2025
151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants