<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">
<div style="color: #333333; border-bottom-width: 8px; border-bottom-color: #ededed; border-bottom-style: solid; font-weight: bold; line-height: 1.4; padding: 20px 0;">
Merge request <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/2053">!2053</a> was reviewed by <a href="https://gitlab.com/wxphaha">xinpeng wang</a>
</div>
<p style="color: #777777;">
<a href="https://gitlab.com/wxphaha">xinpeng wang</a>
commented on a
<a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/2053#note_3007000934">discussion</a>:
</p>
<div class="md" style="border-bottom-width: 4px; border-bottom-color: #ededed; border-bottom-style: solid; padding-bottom: 1em; position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Hi Alexander, thanks for your feedback. Here is the elaboration on the hardware compatibility and the crash scenario:</p>
<ol dir="auto" style="text-align: initial; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Hardware Compatibility Evidence I’ve verified that Hygon CPUs are fully instruction-compatible with the paths enabled in register_x86_intel_crypto. Below is the raw output from a test program on a Hygon Dhyana processor mimicking GnuTLS's read_cpuid_vals():</li>
</ol>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Vendor ID: HygonGenuine</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">ECX (vals[1]): 0x7ed8320b → Bit 25 (AES-NI) is 1; Bit 9 (SSSE3) is 1.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">EBX (vals[2]): 0x209c01a9 → Bit 29 (SHA-NI) is 1; Bit 5 (AVX2) is 1.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">The lscpu flags also confirm the presence of aes, ssse3, pclmulqdq, and sha_ni. Once identified, the existing feature-detection logic works perfectly for Hygon.</p>
<ol start="2" dir="auto" style="text-align: initial; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Elaboration on the Crash (0xc0000094) The issue was observed while running Windows versions of Photoshop via Wine on Linux.</li>
</ol>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">The Trigger: The application calls BCryptDecrypt for AES decryption.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">The Failure: When Hygon is identified as VENDOR_OTHER, GnuTLS bypasses hardware acceleration and falls back to the generic Nettle wrapper.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Observation: IDA Pro analysis of the execution flow in this environment suggests that the generic software path triggers an Integer Divide-by-Zero (0xc0000094).</p>
<p dir="auto" style="color: #3a383f; margin: 0;" align="initial">The Fix: By enabling this patch, GnuTLS correctly initializes the _gnutls_aesni_x86 path. This uses hardware instructions directly, bypassing the problematic software division logic and resolving the crash.</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #626168;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/2053">view it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.com">gitlab.com</a>. <a href="https://gitlab.com/-/sent_notifications/2-6gfahscncracbm2kqvh8ixksj/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.com/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.com/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<span style="color: transparent; font-size: 0; display: none; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.com/gnutls/gnutls/-/merge_requests/2053 at 1768443999
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.com/gnutls/gnutls/-/merge_requests/2053"}}</script>
</p>
</div>
</body>
</html>