-
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
mbedtls_mpi_sub_abs: Skip memcpy when redundant (#6701). #6942
Conversation
In some contexts, the output pointer may equal the first input pointer, in which case copying is not only superfluous but results in "Source and destination overlap in memcpy" errors from Valgrind (as I observed in the context of ecp_double_jac) and a diagnostic message from TrustInSoft Analyzer (as Pascal Cuoq reported in the context of other ECP functions called by cert-app with a suitable certificate). Signed-off-by: Aaron M. Ucko <ucko@ncbi.nlm.nih.gov>
That's fair, though I'll go with the US spelling of "behavior", for which I do see precedent. ;-)
|
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.
LGTM
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.
Looks good to me, but please rewrite the commit messages to ensure that all commits have a signoff line.
Signed-off-by: Aaron M. Ucko <ucko@ncbi.nlm.nih.gov>
AFAICT, only the ChangeLog simplification lacked such a line; fixed. Thanks, and sorry for the accidental omission.
|
Thanks for fixing that; can you prepare the backport now? We normally merge a PR and its backport at the same time, so we need both before this can be merged. |
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.
LGTM; just needs CI (I don't expect any problems now) and the backport
Sounds good, thanks! I've pushed a squashed backport: https://github.com/ucko/mbedtls/tree/2023a-bignum-2.28
|
So I see, thanks. Opened #7001.
|
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.
Thanks, LGTM
It still lacks Mbed-TLS/mbedtls#6942 but now formally calls __GI_memcpy rather than memcpy@@GLIBC_2.14. JIRA: CXX-13141. git-svn-id: https://anonsvn.ncbi.nlm.nih.gov/repos/v1/trunk/c++@100239 78c7ea69-d796-4a43-9a09-de51944f1b03
It still lacks Mbed-TLS/mbedtls#6942 but now formally calls __GI_memcpy rather than memcpy@@GLIBC_2.14. JIRA: CXX-13141. git-svn-id: https://anonsvn.ncbi.nlm.nih.gov/repos/v1/trunk/c++@100239 78c7ea69-d796-4a43-9a09-de51944f1b03
Description
In some contexts, the output pointer may equal the first input pointer, in which case copying is not only superfluous but results in "Source and destination overlap in memcpy" errors from Valgrind (as I observed in the context of ecp_double_jac) and a diagnostic message from TrustInSoft Analyzer (as Pascal Cuoq reported in the context of other ECP functions called by cert-app with a suitable certificate).
I will be happy to supply a corresponding LTS PR in due course, particularly given that I'm using that branch myself.
(Split from #6930.)
Gatekeeper checklist
Notes for the submitter
Please refer to the contributing guidelines, especially the
checklist for PR contributors.