-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Fix mlx kem dup #27173
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 mlx kem dup #27173
Conversation
08b97ec
to
22d4510
Compare
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.
Okay for 3.5 backfit
@vdukhovni Could you please amend the commit message to mention the reporter? I think it is deserved. |
Issue reported by Apple Inc on 2025-03-26.
22d4510
to
2201939
Compare
Ok for 3.5 |
|| (ret = OPENSSL_memdup(key, sizeof(*ret))) == NULL) | ||
return NULL; | ||
|
||
if (ret->propq != NULL |
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.
General what I would do here is set all fields that still need to be copied to NULL right after the memdup. This avoids any issues if returning early and is simple to understand. The MLX_KEY structure should also have a comment on it saying to check the mlx_kem_dup() if any fields are 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.
This is approved & ready to merge, can we do these changes in a subsequent PR?
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.
That's my preference, any refactoring can go in later. With a few different choices available.
This pull request is ready to merge |
Issue reported by Apple Inc on 2025-03-26. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #27173)
Merged to the master and 3.5 branches. Thank you. |
Issue reported by Apple Inc on 2025-03-26. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#27173)
Issue reported by Apple Inc on 2025-03-26. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#27173)
Issue reported by Apple Inc on 2025-03-26. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl#27173)
Trimmed to just the reported issue.