-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix the i386 MPI multiply helper assembly code #1778
Fix the i386 MPI multiply helper assembly code #1778
Conversation
This fix adds the ebx register to the clobber list for the i386 inline assembly for the multiply helper function. ebx was used but not listed, so when the compiler chose to also use it, ebx was getting corrupted. I'm surprised this wasn't spotted sooner. Fixes Github issues Mbed-TLS#1550.
b8419f4
to
5357164
Compare
@redtangent Thank you for your contribution! |
ChangeLog entry added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
LGTM
I've observed this PR doesn't work when |
I'd like to suggest a resolution: skip the assembly when compiling with |
We don't compile in the assembly code if compiler optimisations are disabled as the number of registers used in the assembly code doesn't work with the -O0 option. Also anyone select -O0 probably doesn't want to compile in the assembly code anyway.
I've updated the PR, to disable the assembly code for |
retest |
Description
This is a fix for GitHub issue #1550.
The
ebx
register was used by the assembly code but not listed in the clobber list, so when the compiler chose to also use it,ebx
was getting corrupted. I'm surprised this wasn't spotted sooner.The fix is very simply to add the
ebx
register to the clobber list for the i386 inline assemblyfor the multiply helper function.
This fixes both i386 and its SSE2 variant which was also broken.
Status
READY
Requires Backporting
Yes
Which branch?
mbedtls-2.1
andmbedtls-2.7
. I'll backport once this one's been approved.Additional comments
This should have been caught by the CI, so I suggest
all.sh
needs to be extended. (I haven't checked where or how yet).Todos