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

x86_64 build using crypto acceleration(ASM_X86) produces SHA extension instructions not available on many microarchitectures? #3

Closed
atraczyk opened this issue Jun 14, 2016 · 3 comments

Comments

@atraczyk
Copy link

The 64bit versions of the .asm files produced from the .s files have SHA extention instructions in them, which compile but don't run on the Broadwell-U system I work on. From what I've read on wikipedia and in Intel's docs, it seems these extensions are only available on Goldmont core systems which were unveiled in April. Disabling accelerated crypto is the work around I can find for now.

@Sibras
Copy link
Member

Sibras commented Jun 16, 2016

That shouldnt happen as the code that uses sha instructions wont do so without checking for the returned flags from cpuid first. I looked at the asm and its definitely only running sha instructions when the cpu returns support for it.
When the culprit functions are run what is the status of the "gnutls_x86_cpuid_s" array? Knowing what your cpu is returning may help in identifying the problem.

@atraczyk
Copy link
Author

These are the values in the "gnutls_x86_cpuid_s" array just after "gnutls_cpuid" returns:
[0x00000000] 0x03100800
[0x00000001] 0xfed87383
[0x00000002] 0xbfcbfbff

@Sibras
Copy link
Member

Sibras commented Oct 27, 2016

I managed to track this one down as it appears it was a version inconsistency between the older asm gnutls code expects and the asm used in the project (gnutls pulls all its asm from openssl repo but is incompatible with any of the more recent asm versions). I pushed an update to the repo and updated the latest release on the release page with the appropriate fixes. Let me know if this corrects the problem for you.

@Sibras Sibras closed this as completed Nov 5, 2016
Sibras pushed a commit that referenced this issue Jun 29, 2024
A crash occur in my app that uses gnutls13 early data, stack trace:

  #0  free (libc.so.6 + 0x97bf0)
  #1  _gnutls_buffer_clear (libgnutls.so.30 + 0x77c8c)
  #2  _gnutls13_recv_end_of_early_data (libgnutls.so.30 + 0xaf308)
  #3  _gnutls13_handshake_server (libgnutls.so.30 + 0x42d6c)
  #4  handshake_server (libgnutls.so.30 + 0x4ff6c)

The root cause is that _gnutls_buffer_clear() was trying to free
'buf' that is not initialized or set if GNUTLS_NO_END_OF_EARLY_DATA
flag is set on server side.

This patch fixes it by simply initializing buf at the begginning of
_gnutls13_recv_end_of_early_data().

Signed-off-by: Xin Long <lucien.xin@gmail.com>
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

No branches or pull requests

2 participants