-
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
Specify previously missed register clobbers in AES-NI asm blocks #9809
base: development
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -489,7 +489,7 @@ int mbedtls_aesni_crypt_ecb(mbedtls_aes_context *ctx, | |
"movdqu %%xmm0, (%4) \n\t" // export output | ||
: | ||
: "r" (ctx->nr), "r" (ctx->buf + ctx->rk_offset), "r" (mode), "r" (input), "r" (output) | ||
: "memory", "cc", "xmm0", "xmm1"); | ||
: "memory", "cc", "xmm0", "xmm1", "0", "1"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm checking the other asm blocks in this file. In There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Oh, you're right. Is this something you'd fix separately from this PR? OTOH, I think in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd appreciate it if you could fix those clobber lists while you're at it, so we can say we fixed the assembly in the AESNI code and not just in one function. But if not we'll make a follow-up pull request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I intend to fix these as well (and credit you in the commit message for noticing them), but it's a busy week and it's taking me a while to get back to "free time" work again. Just letting you know that I accepted the task, but can't handle it as a high priority. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just added a commit fixing the missed XMM clobbers and adding a changelog entry. I hope this is as desired. I tested these same changes in a copy/revision of the code as we integrated it in JtR. I temporarily reverted from usage of intrinsics to asm, rebuilt JtR, and ran our tests - so whatever functions we do use there were tested. I also checked the I never tried building/testing mbedTLS proper (sorry!) and quickly trying to do so now first gave me this:
which made me look inside the
Then rerunning
I'm not eager to install a Python module without creating a dedicated environment for this testing first, so I stopped here. I mention this as maybe-useful feedback on maybe improving error messages and maybe relaxing build/test dependencies for new users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No worries, I know all about “free time”! If you prefer, I can take over and finish the patch. Well, you've gone ahead and updated, thank you very much, but I can take over if there further updates are needed.
Feedback noted. Unfortunately, while we'd like to get rid of the Python dependencies, that would require significant engineering work. For what it's worth, releases should be fine on both counts, you just run into these difficulties when you download from a development branch. Hey, at least you didn't have to run autotools! |
||
|
||
return 0; | ||
|
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.
Please add a changelog entry file. Even if we don't know for sure that a platform is affected, insufficient clobbers are a bug. If the next GCC/Clang/MSVC/… triggers the bug, users should be informed of which version of Mbed TLS fixed it.
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.
Would you like me to include this under Security, Bugfix, or Changes? I notice that a previous related change was somehow under Changes:
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.
Under Bugfix, please.
Looking at the history, it seems we messed up the changelog sections in the 2.17.0 release. Originally that entry was under Bugfix.