Dropped options:
- --disable-strip has been inverted (--enable-strip)
- --extra-ldflags=-lm is not needed, meson links libm
- --target-list=i386-softmmu to only keep targets serenity supports
encode() returns without writing anything when emLen < tLen + 11, but
verify() went on to compare the input against that untouched buffer.
For an empty signature both sides are empty, so LibTLS accepted an
empty RSA signature on certificates and on ServerKeyExchange.
get_field_as_string_view used min(strlen(field), N), but strlen scans
for a nul past N before the min applies, over-reading a
non-nul-terminated field past the end of the header. Use strnlen so the
scan stops at N, and route link_name (which had no cap) through the
same helper.
By zeroing registers when returning from crypto functions, we prevent
attackers from accessing sensitive information that could otherwise be
left in these registers.
Note that we currently have no safety regarding the same kind of
leakage but with stack or heap memory.
From some small experiments, the performance cost should be under 5%.
This could probably be optimized by only applying it to the public API.
This allows us to see the coverage of each library without transitive
usages. As an example, Vector::clone() is never tested directly in
Tests/AK, and it's coverage depends on an external test or library. This
means that its coverage is fragile as the code using it in tests might
be dropped in the future.
This will allow everything defined in headers to be instrumented. As an
example, the function `AK::any_of` isn't instantiated inside AK, that
means that no coverage is reported if we don't consider the
instantiation in the test binary itself.
I've been using the nix shell with my system's copy of nixpkgs, running
it against the flake nixpkgs fails due to lua5_5 not being present.
Simply needs an update to fix that.
Max ULP Mean ULP
Before: inf 998274894113382.2500
After: 7352987.00 18.7027
While this is already a lot better, the error is still significant. This
is mainly due to the areas around the roots of lgamma(x) (x=1 and x=2)
where the results are close to zero and thus requires tiny absolute
errors. On (0, 0.7] ∪ [2.3, 8) the maximum error is 20 ULP.
This introduces a lot of polynomials, but I don't think we have another
choice here (CORE-MATH uses even more on the same interval). To find the
subdivisions, I simply searched for x so that a degree 12 polynomial
would have a small error (~1e-18) on [x, 8] and then repeated the
process until the full [0, 8] interval was filled.
This is done by using a polynomial to compensate the mathematical error
term of the stirling approximation.
Max ULP Mean ULP
Before: 6697252309907.00 725249701724.2207
After: 2.00 0.4674