-
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
AES contexts not properly reinitialized in programs/test/benchmark.c
#9775
Comments
Hi, thanks for this report! I think that it is not actually a use-after-free. The However, you're right that we're not following our own documentation here, which states that the As you say, this is in a program rather than the actual library, so it's fine to report in public, but if you find something more critical, please use our security email alias as described here. Thanks again for raising this! |
programs/test/benchmark.c
programs/test/benchmark.c
Having said that, I haven't looked into the CCM/GCM cases, it is possible these are different. I will check those and see if they are different. |
The functions In most cases,
@ShellCode33 How did you notice the problem? If it's based on the function names, it's a false positive. If it's based on static analysis (i.e. actual semantic reasoning, not IA), the cited code looks correct to me. What exactly does the tool report? |
Thanks for the clarification! I didn't use any tool, I was trying to change some of the benchmarks and noticed this with my own eyes. As you said it's a bit misleading, and what comforted me in the fact that it was a mistake is that it is not done like this for all AES benchmarks, take CBC for exemple: mbedtls/programs/test/benchmark.c Lines 726 to 737 in 824a8dc
But I guess there's a reason for it I don't know about |
Hey, a small bug report that is not really impactful considering it is not part of the crypto library itself, but I thought I would let you know anyway.
mbedtls/programs/test/benchmark.c
Lines 803 to 823 in 824a8dc
Notice how the
mbedtls_aes_xts_free
function is called in the loop.There is the same issue for GCM and CCM.
The text was updated successfully, but these errors were encountered: