-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
text### Description
A framework-dependent .NET 9 application using System.Security.Cryptography.AesGcm (or any crypto that triggers AES-GCM decryption) experiences random segmentation faults every few hours (typically 2-12 hours) on Fedora Linux 41.
The crash occurs in OpenSSL's AVX-512 path for AES-GCM decryption:
Process ... (dotnet) crashed in ossl_aes_gcm_decrypt_avx512()
textStack trace from core dump (via abrt-notification):
#21 0x00005606b703fefe _Z9exe_startiPPKc (dotnet + 0x7efe)
#22 0x00005606b704022f main (dotnet + 0x822f)
#25 0x00005606b703ebe5 _start (dotnet + 0x6be5)
textJournalctl logs:
audit[PID]: ANOM_ABEND ... exe="/usr/lib64/dotnet/dotnet" sig=11
systemd-coredump: Process ... (dotnet) ... terminated abnormally with signal 11/SEGV
textThis is intermittent and only happens under load when AES-GCM operations are performed (likely decryption).
Environment
- OS: Fedora Linux 41 (Server Edition)
- Kernel: 6.17.10-100.fc41.x86_64
- .NET: 9.0.11 (runtime) / 9.0.112 (SDK) – installed from Fedora repositories
- OpenSSL: OpenSSL 3.2.6 30 Sep 2025
- CPU: Supports full AVX-512 (including avx512f, avx512dq, avx512ifma, vaes, vpclmulqdq, avx512_vnni, etc.)
- App publish: Framework-dependent (
dotnet MyApp.dll), built withdotnet build -c release - No memory leak; app runs stably otherwise.
Workaround
Setting the following environment variable prevents the crash by disabling VAES/VPCLMULQDQ (fastest AVX-512 paths for GCM):
export OPENSSL_ia32cap="~0x20000000000:~0x40000000000"
textDisabling full AVX-512 also works:
export OPENSSL_ia32cap="~0x2000000000000000"
textThis forces fallback to slower but stable paths (AVX2/AES-NI).
Publishing as self-contained may also avoid it (untested).
Reproduction
Hard to reproduce deterministically due to intermittency, but runs for hours with AES-GCM usage (e.g., encrypted network traffic or data processing) and eventually crashes.
No similar issues found in existing dotnet/runtime issues.
Possible cause
Likely a bug or instability in OpenSSL 3.2.6's AVX-512 AES-GCM implementation (specifically decrypt path) on certain CPUs. .NET delegates AES-GCM to system OpenSSL on Linux.
Suggest considering a runtime workaround (e.g., detect AVX-512 and disable problematic paths via OPENSSL_ia32cap, or fallback to managed implementation).