-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ad4584d
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.
@jedisct1: can you please elaborate on why even consider
-Ofast
in a crypto-library? The option is clearly designed to break normal correctness guarantees.ad4584d
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.
I should mention that apparently with gcc the option also triggers
-ffast-math
and its semantics can apparently leak outside of libsodium into executables that dynamically link against it β even if those executables did not get compiled with any dangerous options (like-ffast-math
is).ad4584d
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.
Continuing to copy important bits from NixOS chat.
The linking propagation is probably fixed with >= gcc 13.1.
ad4584d
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.
For reference, I assume this is the reaction: 7b5c887
BTW, I'm a bit annoyed by that commit message. Let's look into clang docs:
ad4584d
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.
Even if linking propagation may be fixed,
-ffast-math
still alters floating point flags which are set globally in the library constructor and therefore contaminate the entire process environment:https://github.com/gcc-mirror/gcc/blob/releases/gcc-13.2.0/libgcc/config/i386/crtfastmath.c#L82-L98